@eclipse-che/che-e2e 7.76.0-next-9fb1a12 → 7.76.0-next-f98fe6d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/sh-scripts/runDevfileAcceptanceTests.sh +81 -0
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +3 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- package/dist/utils/DevfilesRegistryHelper.js +40 -37
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/package.json +2 -2
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +5 -1
- package/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.ts +10 -0
- package/utils/DevfilesRegistryHelper.ts +41 -39
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# shellcheck source=/dev/null
|
|
3
|
+
|
|
4
|
+
validateParameters(){
|
|
5
|
+
# Validate required parameters
|
|
6
|
+
if [ -z "$TS_API_ACCEPTANCE_TEST_REGISTRY_URL" ] || [ -z "$TS_SELENIUM_BASE_URL" ]; then
|
|
7
|
+
echo "The TS_API_ACCEPTANCE_TEST_REGISTRY_URL or TS_SELENIUM_BASE_URL is not set!";
|
|
8
|
+
echo "Please, set all required environment variable parameters"
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
########################################
|
|
14
|
+
############# Methods ##################
|
|
15
|
+
########################################
|
|
16
|
+
|
|
17
|
+
launchDynamicallyGeneratingAPITests() {
|
|
18
|
+
export MOCHA_SUITE="DynamicallyGeneratingAPITest"
|
|
19
|
+
export RP_LAUNCH_NAME="Devfile Acceptance tests suite"
|
|
20
|
+
echo "MOCHA_SUITE = ${MOCHA_SUITE}"
|
|
21
|
+
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE"
|
|
22
|
+
npm run delayed-test
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
initTestValues() {
|
|
26
|
+
export MOCHA_DIRECTORY="devfile-acceptance-test-suite"
|
|
27
|
+
if [[ "$TS_SELENIUM_BASE_URL" =~ "airgap" || (-n "$IS_CLUSTER_DISCONNECTED" && "$IS_CLUSTER_DISCONNECTED" == "true") ]]
|
|
28
|
+
then
|
|
29
|
+
echo "Disconnected environment"
|
|
30
|
+
else
|
|
31
|
+
echo "Online environment"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
export TEST_ENVIRONMENT="$OCP_INFRA $MOCHA_DIRECTORY $OCP_VERSION"
|
|
35
|
+
export DELETE_WORKSPACE_ON_FAILED_TEST=${DELETE_WORKSPACE_ON_FAILED_TEST:-'false'}
|
|
36
|
+
export DELETE_SCREENCAST_IF_TEST_PASS=${DELETE_SCREENCAST_IF_TEST_PASS:-'true'}
|
|
37
|
+
export NODE_TLS_REJECT_UNAUTHORIZED=${NODE_TLS_REJECT_UNAUTHORIZED:-'0'}
|
|
38
|
+
export TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=${TS_OCP_LOGIN_PAGE_PROVIDER_TITLE:-'htpasswd'}
|
|
39
|
+
export TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS=${TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS:-'1000'}
|
|
40
|
+
export TS_SELENIUM_EDITOR=${TS_SELENIUM_EDITOR:-'che-code'}
|
|
41
|
+
export TS_SELENIUM_EXECUTION_SCREENCAST=${TS_SELENIUM_EXECUTION_SCREENCAST:-'false'}
|
|
42
|
+
export TS_SELENIUM_HEADLESS=${TS_SELENIUM_HEADLESS:-'false'}
|
|
43
|
+
export TS_SELENIUM_LAUNCH_FULLSCREEN=${TS_SELENIUM_LAUNCH_FULLSCREEN:-'true'}
|
|
44
|
+
export TS_SELENIUM_LOG_LEVEL=${TS_SELENIUM_LOG_LEVEL:-'TRACE'}
|
|
45
|
+
export TS_SELENIUM_OCP_PASSWORD=${TS_SELENIUM_OCP_PASSWORD:-''}
|
|
46
|
+
export TS_SELENIUM_OCP_USERNAME=${TS_SELENIUM_OCP_USERNAME:-'admin'}
|
|
47
|
+
export TS_SELENIUM_VALUE_OPENSHIFT_OAUTH=${TS_SELENIUM_VALUE_OPENSHIFT_OAUTH:-'true'}
|
|
48
|
+
export TS_SELENIUM_REPORT_FOLDER=${TS_SELENIUM_REPORT_FOLDER:-'./report'}
|
|
49
|
+
export MOCHA_BAIL=${MOCHA_BAIL:-'false'}
|
|
50
|
+
export MOCHA_RETRIES=${MOCHA_RETRIES:-'1'}
|
|
51
|
+
|
|
52
|
+
echo "TS_SELENIUM_BASE_URL=${TS_SELENIUM_BASE_URL}"
|
|
53
|
+
echo "TEST_ENVIRONMENT=${TEST_ENVIRONMENT}"
|
|
54
|
+
echo "DELETE_WORKSPACE_ON_FAILED_TEST=${DELETE_WORKSPACE_ON_FAILED_TEST}"
|
|
55
|
+
echo "DELETE_SCREENCAST_IF_TEST_PASS=${DELETE_SCREENCAST_IF_TEST_PASS}"
|
|
56
|
+
echo "NODE_TLS_REJECT_UNAUTHORIZED=${NODE_TLS_REJECT_UNAUTHORIZED}"
|
|
57
|
+
echo "TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=${TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}"
|
|
58
|
+
echo "TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS=${TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS}"
|
|
59
|
+
echo "TS_SELENIUM_EDITOR=${TS_SELENIUM_EDITOR}"
|
|
60
|
+
echo "TS_SELENIUM_EXECUTION_SCREENCAST=${TS_SELENIUM_EXECUTION_SCREENCAST}"
|
|
61
|
+
echo "TS_SELENIUM_HEADLESS=${TS_SELENIUM_HEADLESS}"
|
|
62
|
+
echo "TS_SELENIUM_LAUNCH_FULLSCREEN=${TS_SELENIUM_LAUNCH_FULLSCREEN}"
|
|
63
|
+
echo "TS_SELENIUM_LOG_LEVEL=${TS_SELENIUM_LOG_LEVEL}"
|
|
64
|
+
echo "TS_SELENIUM_OCP_USERNAME=${TS_SELENIUM_OCP_USERNAME}"
|
|
65
|
+
echo "TS_SELENIUM_VALUE_OPENSHIFT_OAUTH=${TS_SELENIUM_VALUE_OPENSHIFT_OAUTH}"
|
|
66
|
+
echo "TS_SELENIUM_REPORT_FOLDER=${TS_SELENIUM_REPORT_FOLDER}"
|
|
67
|
+
echo "MOCHA_BAIL=${MOCHA_BAIL}"
|
|
68
|
+
echo "MOCHA_RETRIES=${MOCHA_RETRIES}"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
########################################
|
|
72
|
+
############# Launching ################
|
|
73
|
+
########################################
|
|
74
|
+
|
|
75
|
+
validateParameters
|
|
76
|
+
initTestValues
|
|
77
|
+
echo ""
|
|
78
|
+
echo "Launching devfile acceptance test suite for $TEST_ENVIRONMENT and registry $TS_API_ACCEPTANCE_TEST_REGISTRY_URL"
|
|
79
|
+
echo ""
|
|
80
|
+
launchDynamicallyGeneratingAPITests
|
|
81
|
+
|
|
@@ -8,6 +8,7 @@ const inversify_config_1 = require("../../configs/inversify.config");
|
|
|
8
8
|
const inversify_types_1 = require("../../configs/inversify.types");
|
|
9
9
|
const MOCHA_CONSTANTS_1 = require("../../constants/MOCHA_CONSTANTS");
|
|
10
10
|
const API_TEST_CONSTANTS_1 = require("../../constants/API_TEST_CONSTANTS");
|
|
11
|
+
const BASE_TEST_CONSTANTS_1 = require("../../constants/BASE_TEST_CONSTANTS");
|
|
11
12
|
/**
|
|
12
13
|
* dynamically generating tests
|
|
13
14
|
* info: https://mochajs.org/#delayed-root-suite
|
|
@@ -15,7 +16,8 @@ const API_TEST_CONSTANTS_1 = require("../../constants/API_TEST_CONSTANTS");
|
|
|
15
16
|
void (async function () {
|
|
16
17
|
const devfilesRegistryHelper = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.DevfilesRegistryHelper);
|
|
17
18
|
let devfileSamples = [];
|
|
18
|
-
if (MOCHA_CONSTANTS_1.MOCHA_CONSTANTS.MOCHA_DELAYED_SUITE &&
|
|
19
|
+
if (MOCHA_CONSTANTS_1.MOCHA_CONSTANTS.MOCHA_DELAYED_SUITE &&
|
|
20
|
+
!API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL().includes(BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL)) {
|
|
19
21
|
devfileSamples = await devfilesRegistryHelper.collectPathsToDevfilesFromRegistry(false);
|
|
20
22
|
}
|
|
21
23
|
for (const devfileSample of devfileSamples) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevfileAcceptanceTestAPI.spec.js","sourceRoot":"","sources":["../../../specs/api/DevfileAcceptanceTestAPI.spec.ts"],"names":[],"mappings":";;AAUA,iGAA8F;AAE9F,+BAA8B;AAE9B,uDAAoD;AACpD,+CAA4C;AAC5C,qEAA8D;AAC9D,mEAAwD;AAExD,qEAAkE;AAClE,2EAAwE;
|
|
1
|
+
{"version":3,"file":"DevfileAcceptanceTestAPI.spec.js","sourceRoot":"","sources":["../../../specs/api/DevfileAcceptanceTestAPI.spec.ts"],"names":[],"mappings":";;AAUA,iGAA8F;AAE9F,+BAA8B;AAE9B,uDAAoD;AACpD,+CAA4C;AAC5C,qEAA8D;AAC9D,mEAAwD;AAExD,qEAAkE;AAClE,2EAAwE;AACxE,6EAA0E;AAE1E;;;GAGG;AACH,KAAK,CAAC,KAAK;IACV,MAAM,sBAAsB,GAA2B,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,sBAAsB,CAAC,CAAC;IAExG,IAAI,cAAc,GAAQ,EAAE,CAAC;IAC7B,IACC,iCAAe,CAAC,mBAAmB;QACnC,CAAC,uCAAkB,CAAC,mCAAmC,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,GAAG,EAAE,CAAC;AACP,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** *******************************************************************
|
|
4
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
5
|
+
*
|
|
6
|
+
* This program and the accompanying materials are made
|
|
7
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
8
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
9
|
+
*
|
|
10
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
11
|
+
**********************************************************************/
|
|
12
|
+
require("../../specs/api/DevfileAcceptanceTestAPI.spec");
|
|
13
|
+
//# sourceMappingURL=DynamicallyGeneratingAPITest.suite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicallyGeneratingAPITest.suite.js","sourceRoot":"","sources":["../../../suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.ts"],"names":[],"mappings":";;AAAA;;;;;;;;wEAQwE;AACxE,yDAAuD"}
|
|
@@ -32,50 +32,53 @@ let DevfilesRegistryHelper = class DevfilesRegistryHelper {
|
|
|
32
32
|
}
|
|
33
33
|
async getGitHubCheDevfileRegistryContent() {
|
|
34
34
|
Logger_1.Logger.trace();
|
|
35
|
-
|
|
35
|
+
const url = API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL() === ''
|
|
36
|
+
? API_TEST_CONSTANTS_1.SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL
|
|
37
|
+
: API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL();
|
|
38
|
+
return await this.getContent(url);
|
|
36
39
|
}
|
|
37
|
-
async collectPathsToDevfilesFromRegistry(isInbuilt
|
|
40
|
+
async collectPathsToDevfilesFromRegistry(isInbuilt, sampleNamePatterns) {
|
|
38
41
|
Logger_1.Logger.debug();
|
|
39
42
|
const devfileSamples = [];
|
|
40
43
|
const sampleNames = [];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
sampleNames.push(e.name);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
for (const sample of sampleNames) {
|
|
51
|
-
const sampleEndpoint = `${API_TEST_CONSTANTS_1.SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL}${sample}/meta.yaml`;
|
|
52
|
-
const sampleEndpointContent = await this.getContent(sampleEndpoint);
|
|
53
|
-
const decodedFileContent = Buffer.from(sampleEndpointContent.content, 'base64').toString();
|
|
54
|
-
const metaYamlContent = yaml_1.default.parse(decodedFileContent);
|
|
55
|
-
devfileSamples.push({
|
|
56
|
-
name: sample,
|
|
57
|
-
link: metaYamlContent.links.v2
|
|
58
|
-
});
|
|
44
|
+
if (!isInbuilt) {
|
|
45
|
+
{
|
|
46
|
+
const content = await this.getGitHubCheDevfileRegistryContent();
|
|
47
|
+
content.forEach((e) => {
|
|
48
|
+
if (e.name[0] !== '.') {
|
|
49
|
+
sampleNames.push(e.name);
|
|
59
50
|
}
|
|
60
|
-
|
|
51
|
+
});
|
|
52
|
+
for (const sample of sampleNames) {
|
|
53
|
+
const sampleEndpoint = `${API_TEST_CONSTANTS_1.SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL}${sample}/meta.yaml`;
|
|
54
|
+
const sampleEndpointContent = await this.getContent(sampleEndpoint);
|
|
55
|
+
const decodedFileContent = Buffer.from(sampleEndpointContent.content, 'base64').toString();
|
|
56
|
+
const metaYamlContent = yaml_1.default.parse(decodedFileContent);
|
|
57
|
+
devfileSamples.push({
|
|
58
|
+
name: sample,
|
|
59
|
+
link: metaYamlContent.links.v2
|
|
60
|
+
});
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
Logger_1.Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (isInbuilt) {
|
|
66
|
+
{
|
|
67
|
+
const content = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
|
|
68
|
+
for (const sample of content) {
|
|
69
|
+
const linkToDevWorkspaceYaml = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
|
|
70
|
+
'/devfile-registry' +
|
|
71
|
+
sample.links.devWorkspaces['che-incubator/che-code/latest'];
|
|
72
|
+
devfileSamples.push({
|
|
73
|
+
name: sample.displayName,
|
|
74
|
+
devWorkspaceConfigurationString: await this.getContent(linkToDevWorkspaceYaml)
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
Logger_1.Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
{
|
|
79
82
|
Logger_1.Logger.error(`unsupported registry url - ${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()}\n
|
|
80
83
|
supported registries: ${JSON.stringify(API_TEST_CONSTANTS_1.SUPPORTED_DEVFILE_REGISTRIES)}`);
|
|
81
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevfilesRegistryHelper.js","sourceRoot":"","sources":["../../utils/DevfilesRegistryHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,kDAA6C;AAC7C,qCAAkC;AAClC,gDAAw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E,OAAO,CAAC,CAAC;SACzC;QAAC,OAAO,KAAK,EAAE;YACf,eAAM,CAAC,KAAK,CAAC,GAAG,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC;YAClC,MAAM,KAAK,CAAC;SACZ;QACD,OAAO,QAAQ,EAAE,IAAI,CAAC;IACvB,CAAC;CACD,CAAA;AA9FY,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA8FlC;AA9FY,wDAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-che/che-e2e",
|
|
3
|
-
"version": "7.76.0-next-
|
|
3
|
+
"version": "7.76.0-next-f98fe6d",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly",
|
|
17
17
|
"test-all-devfiles": " ./configs/sh-scripts/initDefaultValues.sh && ./configs/sh-scripts/initDevfileTests.sh",
|
|
18
18
|
"functional-test-suite": "configs/sh-scripts/runFunctionalTests.sh",
|
|
19
|
-
"devfile-acceptance-test-suite": "
|
|
19
|
+
"devfile-acceptance-test-suite": "configs/sh-scripts/runDevfileAcceptanceTests.sh"
|
|
20
20
|
},
|
|
21
21
|
"author": "Ihor Okhrimenko (iokhrime@redhat.com)",
|
|
22
22
|
"license": "ISC",
|
|
@@ -19,6 +19,7 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
19
19
|
import { DevfilesRegistryHelper } from '../../utils/DevfilesRegistryHelper';
|
|
20
20
|
import { MOCHA_CONSTANTS } from '../../constants/MOCHA_CONSTANTS';
|
|
21
21
|
import { API_TEST_CONSTANTS } from '../../constants/API_TEST_CONSTANTS';
|
|
22
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* dynamically generating tests
|
|
@@ -28,7 +29,10 @@ void (async function (): Promise<void> {
|
|
|
28
29
|
const devfilesRegistryHelper: DevfilesRegistryHelper = e2eContainer.get(CLASSES.DevfilesRegistryHelper);
|
|
29
30
|
|
|
30
31
|
let devfileSamples: any = [];
|
|
31
|
-
if (
|
|
32
|
+
if (
|
|
33
|
+
MOCHA_CONSTANTS.MOCHA_DELAYED_SUITE &&
|
|
34
|
+
!API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL().includes(BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL)
|
|
35
|
+
) {
|
|
32
36
|
devfileSamples = await devfilesRegistryHelper.collectPathsToDevfilesFromRegistry(false);
|
|
33
37
|
}
|
|
34
38
|
for (const devfileSample of devfileSamples) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/api/DevfileAcceptanceTestAPI.spec';
|
|
@@ -28,54 +28,56 @@ export class DevfilesRegistryHelper {
|
|
|
28
28
|
async getGitHubCheDevfileRegistryContent(): Promise<AxiosResponse> {
|
|
29
29
|
Logger.trace();
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const url: string =
|
|
32
|
+
API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL() === ''
|
|
33
|
+
? SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL
|
|
34
|
+
: API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL();
|
|
35
|
+
return await this.getContent(url);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
async collectPathsToDevfilesFromRegistry(isInbuilt: boolean
|
|
38
|
+
async collectPathsToDevfilesFromRegistry(isInbuilt: boolean, sampleNamePatterns?: string[]): Promise<object[]> {
|
|
35
39
|
Logger.debug();
|
|
36
40
|
|
|
37
41
|
const devfileSamples: object[] = [];
|
|
38
42
|
const sampleNames: string[] = [];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
sampleNames.push(e.name);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
for (const sample of sampleNames) {
|
|
50
|
-
const sampleEndpoint: string = `${SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL}${sample}/meta.yaml`;
|
|
51
|
-
const sampleEndpointContent: AxiosResponse = await this.getContent(sampleEndpoint);
|
|
52
|
-
const decodedFileContent: string = Buffer.from((sampleEndpointContent as any).content, 'base64').toString();
|
|
53
|
-
const metaYamlContent: any = YAML.parse(decodedFileContent);
|
|
54
|
-
devfileSamples.push({
|
|
55
|
-
name: sample,
|
|
56
|
-
link: metaYamlContent.links.v2
|
|
57
|
-
});
|
|
43
|
+
if (!isInbuilt) {
|
|
44
|
+
{
|
|
45
|
+
const content: any[any] = await this.getGitHubCheDevfileRegistryContent();
|
|
46
|
+
content.forEach((e: any): void => {
|
|
47
|
+
if (e.name[0] !== '.') {
|
|
48
|
+
sampleNames.push(e.name);
|
|
58
49
|
}
|
|
59
|
-
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
for (const sample of sampleNames) {
|
|
53
|
+
const sampleEndpoint: string = `${SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL}${sample}/meta.yaml`;
|
|
54
|
+
const sampleEndpointContent: AxiosResponse = await this.getContent(sampleEndpoint);
|
|
55
|
+
const decodedFileContent: string = Buffer.from((sampleEndpointContent as any).content, 'base64').toString();
|
|
56
|
+
const metaYamlContent: any = YAML.parse(decodedFileContent);
|
|
57
|
+
devfileSamples.push({
|
|
58
|
+
name: sample,
|
|
59
|
+
link: metaYamlContent.links.v2
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
62
|
+
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
63
|
+
}
|
|
64
|
+
} else if (isInbuilt) {
|
|
65
|
+
{
|
|
66
|
+
const content: any[any] = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
|
|
67
|
+
for (const sample of content) {
|
|
68
|
+
const linkToDevWorkspaceYaml: any =
|
|
69
|
+
BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
|
|
70
|
+
'/devfile-registry' +
|
|
71
|
+
sample.links.devWorkspaces['che-incubator/che-code/latest'];
|
|
72
|
+
devfileSamples.push({
|
|
73
|
+
name: sample.displayName,
|
|
74
|
+
devWorkspaceConfigurationString: await this.getContent(linkToDevWorkspaceYaml)
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
{
|
|
79
81
|
Logger.error(`unsupported registry url - ${API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()}\n
|
|
80
82
|
supported registries: ${JSON.stringify(SUPPORTED_DEVFILE_REGISTRIES)}`);
|
|
81
83
|
}
|