@eclipse-che/che-e2e 7.76.0-next-a90153c → 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.
Files changed (48) hide show
  1. package/configs/mocharc.ts +4 -2
  2. package/configs/reporters.config.js +51 -0
  3. package/configs/sh-scripts/runDevfileAcceptanceTests.sh +81 -0
  4. package/configs/sh-scripts/runFunctionalTests.sh +6 -6
  5. package/constants/BASE_TEST_CONSTANTS.ts +15 -3
  6. package/constants/MOCHA_CONSTANTS.ts +5 -2
  7. package/constants/REPORTER_CONSTANTS.ts +98 -5
  8. package/constants/TIMEOUT_CONSTANTS.ts +10 -22
  9. package/dist/configs/mocharc.js +4 -2
  10. package/dist/configs/mocharc.js.map +1 -1
  11. package/dist/constants/BASE_TEST_CONSTANTS.js +12 -2
  12. package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
  13. package/dist/constants/MOCHA_CONSTANTS.js +3 -2
  14. package/dist/constants/MOCHA_CONSTANTS.js.map +1 -1
  15. package/dist/constants/REPORTER_CONSTANTS.js +70 -2
  16. package/dist/constants/REPORTER_CONSTANTS.js.map +1 -1
  17. package/dist/constants/TIMEOUT_CONSTANTS.js +0 -8
  18. package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -1
  19. package/dist/specs/MochaHooks.js +4 -3
  20. package/dist/specs/MochaHooks.js.map +1 -1
  21. package/dist/specs/SmokeTest.spec.js +1 -1
  22. package/dist/specs/SmokeTest.spec.js.map +1 -1
  23. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +3 -1
  24. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
  25. package/dist/specs/api/EmptyWorkspaceAPI.spec.js +0 -3
  26. package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
  27. package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js +13 -0
  28. package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js.map +1 -0
  29. package/dist/tests-library/LoginTests.js +1 -1
  30. package/dist/tests-library/LoginTests.js.map +1 -1
  31. package/dist/utils/DevWorkspaceConfigurationHelper.js +2 -1
  32. package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
  33. package/dist/utils/DevfilesRegistryHelper.js +40 -37
  34. package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
  35. package/dist/utils/KubernetesCommandLineToolsExecutor.js +9 -8
  36. package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
  37. package/package.json +10 -9
  38. package/specs/MochaHooks.ts +4 -3
  39. package/specs/SmokeTest.spec.ts +1 -1
  40. package/specs/api/DevfileAcceptanceTestAPI.spec.ts +5 -1
  41. package/specs/api/EmptyWorkspaceAPI.spec.ts +0 -4
  42. package/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.ts +10 -0
  43. package/tests-library/LoginTests.ts +4 -1
  44. package/tsconfig.json +1 -1
  45. package/utils/DevWorkspaceConfigurationHelper.ts +4 -1
  46. package/utils/DevfilesRegistryHelper.ts +41 -39
  47. package/utils/KubernetesCommandLineToolsExecutor.ts +8 -8
  48. package/configs/reporters-config.json +0 -6
@@ -28,54 +28,56 @@ export class DevfilesRegistryHelper {
28
28
  async getGitHubCheDevfileRegistryContent(): Promise<AxiosResponse> {
29
29
  Logger.trace();
30
30
 
31
- return await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL);
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 = true, sampleNamePatterns?: string[]): Promise<object[]> {
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
- switch (isInbuilt) {
40
- case false:
41
- {
42
- const content: any[any] = await this.getGitHubCheDevfileRegistryContent();
43
- content.forEach((e: any): void => {
44
- if (e.name[0] !== '.') {
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
- Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
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
- break;
62
- case true:
63
- {
64
- const content: any[any] = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
65
- for (const sample of content) {
66
- const linkToDevWorkspaceYaml: any =
67
- BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
68
- '/devfile-registry' +
69
- sample.links.devWorkspaces['che-incubator/che-code/latest'];
70
- devfileSamples.push({
71
- name: sample.displayName,
72
- devWorkspaceConfigurationString: await this.getContent(linkToDevWorkspaceYaml)
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
- break;
78
- default: {
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
  }
@@ -46,14 +46,14 @@ export class KubernetesCommandLineToolsExecutor implements IKubernetesCommandLin
46
46
  }
47
47
 
48
48
  get namespace(): string | undefined {
49
- this._namespace =
50
- this._namespace !== undefined
51
- ? this._namespace
52
- : BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.includes('devspaces')
53
- ? OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME + '-devspaces'
54
- : BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.includes('che')
55
- ? OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME + '-che'
56
- : 'default';
49
+ if (!this._namespace) {
50
+ const applicationName: string = BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME();
51
+ if (applicationName === 'default') {
52
+ this._namespace = applicationName;
53
+ } else {
54
+ this._namespace = OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME + '-' + applicationName;
55
+ }
56
+ }
57
57
  return this._namespace;
58
58
  }
59
59
 
@@ -1,6 +0,0 @@
1
- {
2
- "reporterEnabled": "allure-mocha,dist/utils/CheReporter.js",
3
- "allureMochaReporterOptions": {
4
- "resultsDir": ".allure-results"
5
- }
6
- }