Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Update to 7.11.0 #1828

Merged
merged 5 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"configuration": {
"menu": {
"disabled": ["organizations"]
"disabled": ["organizations", "factories"]
},
"features": {
"disabled": ["workspaceSharing", "kubernetesNamespaceSelector"]
Expand Down
5 changes: 3 additions & 2 deletions dockerfiles/e2e-saas/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ fi
if [ -z $DEBUG_LEVEL ]; then
DEBUG_LEVEL="DEBUG"
fi
if [ -z $DEBUG_LEVEL ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ScrewTSW this line already exists above

DEBUG_LEVEL="DEBUG"
fi

cd rh-che
length=${#USERNAME}
Expand Down Expand Up @@ -143,9 +146,7 @@ export DISPLAY=:1.0

echo "Applying patches..."
# currently in /tmp/rh-che folder
patch -u ../e2e/pageobjects/dashboard/Dashboard.ts -i ../test_patches/Dashboard.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Katka92 so, in 7.11 e2e tests are not dependent on the UD tabs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, but only on Workspaces, Stacks and Getting started.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch we were using was removing checks for Factories and Dashboard

patch -u ../e2e/utils/requestHandlers/CheApiRequestHandler.ts -i ../test_patches/CheApiRequestHandler.patch
patch -u ../e2e/package.json -i ../test_patches/upstream_package.patch

# rebuild upstream patched code
cd ../e2e && npm i && tsc && cd ../rh-che
Expand Down
50 changes: 27 additions & 23 deletions dockerfiles/e2e-saas/test_patches/CheApiRequestHandler.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/tests/e2e/utils/requestHandlers/CheApiRequestHandler.ts b/tests/e2e/utils/requestHandlers/CheApiRequestHandler.ts
index 4d9ab66fa9..5d061062d1 100644
index 4d9ab66fa9..48ef828d30 100644
--- a/tests/e2e/utils/requestHandlers/CheApiRequestHandler.ts
+++ b/tests/e2e/utils/requestHandlers/CheApiRequestHandler.ts
@@ -8,11 +8,12 @@
@@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/

Expand All @@ -11,26 +11,24 @@ index 4d9ab66fa9..5d061062d1 100644
import { TestConstants } from '../../TestConstants';
import { TYPES } from '../../inversify.types';
import { inject, injectable } from 'inversify';
import { IAuthorizationHeaderHandler } from './headers/IAuthorizationHeaderHandler';
+import lodash from 'lodash';
@@ -16,6 +16,46 @@ import { IAuthorizationHeaderHandler } from './headers/IAuthorizationHeaderHandl

@injectable()
export class CheApiRequestHandler {
@@ -30,6 +31,37 @@ export class CheApiRequestHandler {
return await axios.delete(this.assembleUrl(relativeUrl), await this.headerHandler.get());
}

+
+ /**
+ * This method adds a request interceptor into axios request interceptors list and returns an ID of the interceptor
+ */
+ public static enableRequestInteceptor(): number {
+ console.log(`CheApiRequestHandler.enableRequestInterceptor`);
+ return axios.interceptors.request.use( request => {
+ if (TestConstants.TS_SELENIUM_LOG_LEVEL === "TRACE") {
+ let request_censored: AxiosRequestConfig = lodash.cloneDeep(request);
+ request_censored.headers['Authorization'] = "CENSORED";
+ console.log(`RequestHandler request:\n`, request_censored);
+ }
+ try {
+ let request_censored: AxiosRequestConfig = JSON.parse(JSON.stringify(request));
+ request_censored.headers['Authorization'] = 'CENSORED';
+ console.log(`RequestHandler request:\n`, request_censored);
+ } catch (err) {
+ console.log(`RequestHandler request: Failed to deep clone AxiosRequestConfig:`, err);
+ }
+ return request;
+ });
+ }
Expand All @@ -41,16 +39,22 @@ index 4d9ab66fa9..5d061062d1 100644
+ public static enableResponseInterceptor(): number {
+ console.log(`CheApiRequestHandler.enableResponseRedirects`);
+ return axios.interceptors.response.use( response => {
+ if (TestConstants.TS_SELENIUM_LOG_LEVEL === "TRACE") {
+ let response_censored: AxiosResponse = lodash.cloneDeep(response);
+ response_censored.config.headers["Authorization"] = "CENSORED";
+ response_censored.request = "CENSORED";
+ console.log(`RequestHandler response:\n`, response_censored);
+ }
+ try {
+ let response_censored: AxiosResponse = JSON.parse(JSON.stringify(response, (key, value) => {
+ switch (key) {
+ case 'request': return 'CENSORED';
+ default: return value;
+ }
+ }));
+ response_censored.config.headers['Authorization'] = 'CENSORED';
+ console.log(`RequestHandler response:\n`, response_censored);
+ } catch (err) {
+ console.log(`RequestHandler response: Failed to deep clone AxiosResponse:`, err);
+ }
+ return response;
+ })
+ });
+ }
+
private assembleUrl(relativeUrl: string): string {
return `${TestConstants.TS_SELENIUM_BASE_URL}/${relativeUrl}`;
}
constructor(@inject(TYPES.IAuthorizationHeaderHandler) private readonly headerHandler: IAuthorizationHeaderHandler) { }

async get(relativeUrl: string): Promise<AxiosResponse> {
15 changes: 0 additions & 15 deletions dockerfiles/e2e-saas/test_patches/Dashboard.patch

This file was deleted.

1 change: 0 additions & 1 deletion e2e-saas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@types/node": "^11.13.4",
"@types/rimraf": "^2.0.3",
"@types/selenium-webdriver": "^3.0.16",
"@types/lodash": "^4.14.149",
"axios": "^0.19.2",
"chai": "^4.2.0",
"chromedriver": "^2.46.0",
Expand Down
6 changes: 4 additions & 2 deletions e2e-saas/utils/RhCheReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class RhCheReporter extends mocha.reporters.Spec {
console.log(launchInformation);

rm.sync(TestConstants.TS_SELENIUM_REPORT_FOLDER);
CheApiRequestHandler.enableRequestInteceptor();
CheApiRequestHandler.enableResponseInterceptor();
if (TestConstants.TS_SELENIUM_LOG_LEVEL === "TRACE") {
CheApiRequestHandler.enableRequestInteceptor();
CheApiRequestHandler.enableResponseInterceptor();
}
preferencesHalder.setConfirmExit(AskForConfirmationType.never);
});

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>7.10.0</version>
<version>7.11.0</version>
</parent>
<groupId>com.redhat.che</groupId>
<artifactId>fabric8-ide-parent</artifactId>
Expand All @@ -31,7 +31,7 @@
<module>functional-tests</module>
</modules>
<properties>
<che.version>7.10.0</che.version>
<che.version>7.11.0</che.version>
<keycloak.version>2.5.0.Final</keycloak.version>
<redhat.che.version>1.0.0-SNAPSHOT</redhat.che.version>
<rh.che.plugins.version>1.0.0-SNAPSHOT</rh.che.plugins.version>
Expand Down