@eclipse-che/che-e2e 7.102.0-next-fcf5867 → 7.102.0-next-36ecc36
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/CODE_STYLE.md +9 -20
- package/README.md +37 -39
- package/constants/FACTORY_TEST_CONSTANTS.ts +6 -0
- package/dist/constants/FACTORY_TEST_CONSTANTS.js +4 -0
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -1
- package/dist/specs/api/BuildPushRunPodmanContainerAPI.spec.js +23 -14
- package/dist/specs/api/BuildPushRunPodmanContainerAPI.spec.js.map +1 -1
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js +15 -1
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js.map +1 -1
- package/package.json +2 -2
- package/specs/api/BuildPushRunPodmanContainerAPI.spec.ts +26 -14
- package/specs/miscellaneous/KubedockPodmanTest.spec.ts +15 -1
package/CODE_STYLE.md
CHANGED
|
@@ -6,35 +6,24 @@
|
|
|
6
6
|
|
|
7
7
|
Coding standards offer several advantages, including:
|
|
8
8
|
|
|
9
|
-
1. Increase Code Quality: By adhering to coding standards, developers can create code that is more secure, efficient,
|
|
10
|
-
maintainable, and uniform. This, in turn, can result in fewer errors and improved overall performance.
|
|
9
|
+
1. Increase Code Quality: By adhering to coding standards, developers can create code that is more secure, efficient, maintainable, and uniform. This, in turn, can result in fewer errors and improved overall performance.
|
|
11
10
|
|
|
12
|
-
2. Improved Readability and Maintainability: Coding standards contribute to code that is more comprehensible and easier
|
|
13
|
-
to maintain. Consistently formatted code aids other developers in comprehending and modifying it, saving time and
|
|
14
|
-
reducing the likelihood of introducing errors.
|
|
11
|
+
2. Improved Readability and Maintainability: Coding standards contribute to code that is more comprehensible and easier to maintain. Consistently formatted code aids other developers in comprehending and modifying it, saving time and reducing the likelihood of introducing errors.
|
|
15
12
|
|
|
16
|
-
3. Accelerated Development: The adherence to coding standards can expedite the development process. When developers
|
|
17
|
-
adhere to a predefined set of guidelines, they can produce code more swiftly and with fewer mistakes. Additionally,
|
|
18
|
-
uniform code formatting facilitates the identification and resolution of issues.
|
|
13
|
+
3. Accelerated Development: The adherence to coding standards can expedite the development process. When developers adhere to a predefined set of guidelines, they can produce code more swiftly and with fewer mistakes. Additionally, uniform code formatting facilitates the identification and resolution of issues.
|
|
19
14
|
|
|
20
|
-
4. Better Scalability: Coding standards facilitate the creation of scalable code, simplifying the incorporation of new
|
|
21
|
-
features or updates. Consistent coding practices also streamline code maintenance as the codebase expands.
|
|
15
|
+
4. Better Scalability: Coding standards facilitate the creation of scalable code, simplifying the incorporation of new features or updates. Consistent coding practices also streamline code maintenance as the codebase expands.
|
|
22
16
|
|
|
23
|
-
5. Elevated Collaboration and Communication: Uniform guidelines encourage better understanding and manipulation of code
|
|
24
|
-
written by fellow developers. This fosters smoother teamwork and facilitates the sharing of code.
|
|
17
|
+
5. Elevated Collaboration and Communication: Uniform guidelines encourage better understanding and manipulation of code written by fellow developers. This fosters smoother teamwork and facilitates the sharing of code.
|
|
25
18
|
|
|
26
|
-
6. Consistency Across Projects: The adoption of coding standards guarantees a consistent coding approach across various
|
|
27
|
-
projects. This simplifies the task of upholding code quality, transitioning between tasks, and fostering
|
|
28
|
-
collaborative work.
|
|
19
|
+
6. Consistency Across Projects: The adoption of coding standards guarantees a consistent coding approach across various projects. This simplifies the task of upholding code quality, transitioning between tasks, and fostering collaborative work.
|
|
29
20
|
|
|
30
21
|
### Automated tools
|
|
31
22
|
|
|
32
|
-
Automated lint checking and code format performs with ESLint and Prettier tools before every commit using Husky
|
|
33
|
-
pre-commit hook.
|
|
34
|
-
Full set of rules can be found:
|
|
23
|
+
Automated lint checking and code format performs with ESLint and Prettier tools before every commit using Husky pre-commit hook. Full set of rules can be found:
|
|
35
24
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
25
|
+
- [.eslintrc](.eslintrc.js)
|
|
26
|
+
- [.prettierrc](.prettierrc.json)
|
|
38
27
|
|
|
39
28
|
### Preferable code style
|
|
40
29
|
|
package/README.md
CHANGED
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
## Requirements
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
5
|
+
- node 16.x
|
|
6
|
+
- "Chrome" browser 114.x or later
|
|
7
|
+
- deployed Che 7 with accessible URL
|
|
8
8
|
|
|
9
9
|
## Before launch
|
|
10
10
|
|
|
11
11
|
**Perform commands:**
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
- `export TS_SELENIUM_BASE_URL=<Che7 URL>`
|
|
14
|
+
- `npm ci`
|
|
15
15
|
|
|
16
16
|
Note: If there is any modifications in package.json, manually execute the `npm install` to update the package-lock.json. So that errors can be avoided while executing npm ci
|
|
17
17
|
|
|
18
18
|
## Default launch
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
20
|
+
- Provide connection credentials:
|
|
21
|
+
- `export TS_SELENIUM_OCP_USERNAME=<username>`
|
|
22
|
+
- `export TS_SELENIUM_OCP_PASSWORD=<password>`
|
|
23
|
+
- `npm run test`
|
|
24
24
|
|
|
25
25
|
## Custom launch
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
27
|
+
- Use environment variables which described in the "constants" folder
|
|
28
|
+
- Use environment variables for setting timeouts if needed. You can see the list in **`'TimeoutConstants.ts'`**. You can see the list of those variables and their value if you set the `'TS_SELENIUM_PRINT_TIMEOUT_VARIABLES = true'`
|
|
29
|
+
- To test one specification export file name as `export USERSTORY=<spec-file-name-without-extension> && npm run test` (example: `-e USERSTORY=Quarkus`)
|
|
30
|
+
- To run test without Selenium WebDriver (API tests etc.) use `export USERSTORY=<spec-file-name-without-extension> && npm run driver-less-test` (example: `-e USERSTORY=CloneGitRepoAPI`)
|
|
31
|
+
- This project support application testing deployed on Kubernetes or Openshift platform. Openshift is default value. To switch into Kubernetes, please, use `TS_PLATFORM=kubernetes` environmental variable and `TS_SELENIUM_K8S_PASSWORD`, `TS_SELENIUM_K8S_USERNAME` to provide credentials. The sample of test command in this case:
|
|
32
32
|
```
|
|
33
33
|
export TS_PLATFORM=kubernetes && \
|
|
34
34
|
export TS_SELENIUM_K8S_USERNAME=<username> && \
|
|
@@ -37,21 +37,21 @@ Note: If there is any modifications in package.json, manually execute the `npm i
|
|
|
37
37
|
npm run test
|
|
38
38
|
```
|
|
39
39
|
Also, environmental variables can be set in files in "constants" folder.
|
|
40
|
-
-
|
|
40
|
+
- Local test results can be represented with Allure reporter `npm run open-allure-dasboard`
|
|
41
41
|
|
|
42
42
|
## Docker launch
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
44
|
+
- open terminal and go to the "e2e" directory
|
|
45
|
+
- export the `"TS_SELENIUM_BASE_URL"` variable with "Che" url
|
|
46
|
+
- run command `"npm run test-docker"`
|
|
47
47
|
|
|
48
48
|
## Docker launch with changed tests
|
|
49
49
|
|
|
50
50
|
**For launching tests with local changes perform next steps:**
|
|
51
51
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
52
|
+
- open terminal and go to the "e2e" directory
|
|
53
|
+
- export the `"TS_SELENIUM_BASE_URL"` variable with "Che" url
|
|
54
|
+
- run command `"npm run test-docker-mount-e2e"`
|
|
55
55
|
|
|
56
56
|
## Debug docker launch
|
|
57
57
|
|
|
@@ -59,30 +59,28 @@ The `'eclipse/che-e2e'` docker image has VNC server installed inside. For connec
|
|
|
59
59
|
|
|
60
60
|
## The "Happy Path" scenario launching
|
|
61
61
|
|
|
62
|
-
**The easiest way to do that is to perform steps which are described in the "Docker launch" paragraph.
|
|
63
|
-
For running tests without docker, please perform next steps:**
|
|
62
|
+
**The easiest way to do that is to perform steps which are described in the "Docker launch" paragraph. For running tests without docker, please perform next steps:**
|
|
64
63
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
- perform command **`export USERSTORY=$TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME && npm run test-all-devfiles`**
|
|
64
|
+
- Deploy Che on Kubernetes infrastructure by using 'Minikube' and 'Chectl' <https://github.com/eclipse-che/che-server/blob/HEAD/deploy/kubernetes/README.md>
|
|
65
|
+
- Create workspace by using 'Chectl' and devfile
|
|
66
|
+
- link to 'Chectl' manual <https://github.com/che-incubator/chectl#chectl-workspacestart>
|
|
67
|
+
- link to devfile ( **`For successfull test passing, exactly provided devfile should be used`** ) <https://gist.githubusercontent.com/Ohrimenko1988/93f5426f4ebc1705c55feb8ff0396a49/raw/cbea89ad145ba33ed34a151a12c50f045f9f3b78/yaml-ls-bug.yaml>
|
|
68
|
+
- Provide the **`'TS_SELENIUM_BASE_URL'`** environment variable as described above
|
|
69
|
+
- export TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME=EmptyWorkspace (default value, see BASE_TEST_CONSTANTS.ts)
|
|
70
|
+
- perform command **`export USERSTORY=$TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME && npm run test-all-devfiles`**
|
|
73
71
|
|
|
74
72
|
## Launching the DevWorkspaceHappyPath spec file using Che with oauth authentication
|
|
75
73
|
|
|
76
74
|
**Setup next environment variables:**
|
|
77
75
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
76
|
+
- export TS_SELENIUM_BASE_URL=\<Che-URL\>
|
|
77
|
+
- export TS_SELENIUM_OCP_USERNAME=\<cluster-username\>
|
|
78
|
+
- export TS_SELENIUM_OCP_PASSWORD=\<cluster-password\>
|
|
79
|
+
- export TS_SELENIUM_VALUE_OPENSHIFT_OAUTH="true"
|
|
80
|
+
- export TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=\<login-provide-title\>
|
|
81
|
+
- export TS_SELENIUM_DEVWORKSPACE_URL=\<devworkspace-url\>
|
|
82
|
+
- export TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME=EmptyWorkspace (default value, see BASE_TEST_CONSTANTS.ts)
|
|
85
83
|
|
|
86
84
|
**Execute the npm command:**
|
|
87
85
|
|
|
88
|
-
-
|
|
86
|
+
- perform command `export USERSTORY=$TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME && npm run test-all-devfiles`
|
|
@@ -20,6 +20,7 @@ export enum GitProviderType {
|
|
|
20
20
|
|
|
21
21
|
export const FACTORY_TEST_CONSTANTS: {
|
|
22
22
|
TS_SELENIUM_FACTORY_GIT_REPO_URL: string;
|
|
23
|
+
TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL: string;
|
|
23
24
|
TS_SELENIUM_PROJECT_NAME: string;
|
|
24
25
|
TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO: boolean;
|
|
25
26
|
TS_SELENIUM_FACTORY_GIT_PROVIDER: string;
|
|
@@ -36,6 +37,11 @@ export const FACTORY_TEST_CONSTANTS: {
|
|
|
36
37
|
*/
|
|
37
38
|
TS_SELENIUM_FACTORY_GIT_REPO_URL: process.env.TS_SELENIUM_FACTORY_GIT_REPO_URL || '',
|
|
38
39
|
|
|
40
|
+
/**
|
|
41
|
+
* url to create factory for airgap/disconnected environments
|
|
42
|
+
*/
|
|
43
|
+
TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL: process.env.TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL || '',
|
|
44
|
+
|
|
39
45
|
/**
|
|
40
46
|
* git repository name
|
|
41
47
|
*/
|
|
@@ -29,6 +29,10 @@ exports.FACTORY_TEST_CONSTANTS = {
|
|
|
29
29
|
* url to create factory
|
|
30
30
|
*/
|
|
31
31
|
TS_SELENIUM_FACTORY_GIT_REPO_URL: process.env.TS_SELENIUM_FACTORY_GIT_REPO_URL || '',
|
|
32
|
+
/**
|
|
33
|
+
* url to create factory for airgap/disconnected environments
|
|
34
|
+
*/
|
|
35
|
+
TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL: process.env.TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL || '',
|
|
32
36
|
/**
|
|
33
37
|
* git repository name
|
|
34
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FACTORY_TEST_CONSTANTS.js","sourceRoot":"","sources":["../../constants/FACTORY_TEST_CONSTANTS.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;wEAQwE;AACxE,+DAA4D;AAE5D,IAAY,eAOX;AAPD,WAAY,eAAe;IAC1B,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,sEAAmD,CAAA;IACnD,sEAAmD,CAAA;IACnD,2DAAwC,CAAA;IACxC,gDAA6B,CAAA;AAC9B,CAAC,EAPW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAO1B;AAEY,QAAA,sBAAsB,
|
|
1
|
+
{"version":3,"file":"FACTORY_TEST_CONSTANTS.js","sourceRoot":"","sources":["../../constants/FACTORY_TEST_CONSTANTS.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;wEAQwE;AACxE,+DAA4D;AAE5D,IAAY,eAOX;AAPD,WAAY,eAAe;IAC1B,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,sEAAmD,CAAA;IACnD,sEAAmD,CAAA;IACnD,2DAAwC,CAAA;IACxC,gDAA6B,CAAA;AAC9B,CAAC,EAPW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAO1B;AAEY,QAAA,sBAAsB,GAQ/B;IACH;;OAEG;IACH,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,eAAe,CAAC,MAAM;IAExG;;OAEG;IACH,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,EAAE;IAEpF;;OAEG;IACH,uCAAuC,EAAE,OAAO,CAAC,GAAG,CAAC,uCAAuC,IAAI,EAAE;IAElG;;OAEG;IACH,wBAAwB,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE;IAEpE;;OAEG;IACH,uCAAuC,EAAE,OAAO,CAAC,GAAG,CAAC,uCAAuC,KAAK,MAAM;IAEvG;;OAEG;IACH,mCAAmC,EAAE,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI,QAAQ;IAEhG;;OAEG;IACH,uBAAuB;QACtB,OAAO,CACN,OAAO,CAAC,GAAG,CAAC,uBAAuB;YACnC,yCAAmB,CAAC,oBAAoB,GAAG,eAAe,GAAG,IAAI,CAAC,gCAAgC,CAClG,CAAC;IACH,CAAC;CACD,CAAC"}
|
|
@@ -15,6 +15,7 @@ const inversify_types_1 = require("../../configs/inversify.types");
|
|
|
15
15
|
const BASE_TEST_CONSTANTS_1 = require("../../constants/BASE_TEST_CONSTANTS");
|
|
16
16
|
const WorkspaceHandlingTests_1 = require("../../tests-library/WorkspaceHandlingTests");
|
|
17
17
|
const MochaHooks_1 = require("../MochaHooks");
|
|
18
|
+
const FACTORY_TEST_CONSTANTS_1 = require("../../constants/FACTORY_TEST_CONSTANTS");
|
|
18
19
|
suite(`Test podman build container functionality ${BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function () {
|
|
19
20
|
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
|
|
20
21
|
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
|
|
@@ -28,6 +29,16 @@ suite(`Test podman build container functionality ${BASE_TEST_CONSTANTS_1.BASE_TE
|
|
|
28
29
|
let originalBuildCapabilitiesSetting = '';
|
|
29
30
|
let devSpacesNamespace = '';
|
|
30
31
|
let cheClusterName = '';
|
|
32
|
+
/**
|
|
33
|
+
* test requires the following files to be present in the workspace root:
|
|
34
|
+
* - A Dockerfile named Dockerfile.${ARCH} with content:
|
|
35
|
+
* FROM scratch
|
|
36
|
+
* COPY hello /hello
|
|
37
|
+
* CMD ["/hello"]
|
|
38
|
+
* - A compiled 'hello' binary, that prints "Hello from Kubedock!" to output.
|
|
39
|
+
*
|
|
40
|
+
* Used to build and run a container in a pod for verifying Podman functionality.
|
|
41
|
+
*/
|
|
31
42
|
const buildPushScript = `
|
|
32
43
|
export ARCH=$(uname -m)
|
|
33
44
|
export DATE=$(date +"%m%d%y")
|
|
@@ -36,19 +47,10 @@ export TKN=$(oc whoami -t)
|
|
|
36
47
|
export REG="image-registry.openshift-image-registry.svc:5000"
|
|
37
48
|
export PROJECT=$(oc project -q)
|
|
38
49
|
export IMG="\${REG}/\${PROJECT}/hello:\${DATE}"
|
|
39
|
-
|
|
40
|
-
# Create test directory and Dockerfile
|
|
41
|
-
mkdir -p /projects/dockerfile-test
|
|
42
|
-
cd /projects/dockerfile-test
|
|
43
|
-
|
|
44
|
-
cat > Dockerfile << EOF
|
|
45
|
-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
|
|
46
|
-
RUN echo "Hello from Kubedock!" > /hello.txt
|
|
47
|
-
CMD ["cat", "/hello.txt"]
|
|
48
|
-
EOF
|
|
50
|
+
cd $PROJECT_SOURCE
|
|
49
51
|
|
|
50
52
|
podman login --tls-verify=false --username "\${USER}" --password "\${TKN}" "\${REG}"
|
|
51
|
-
podman build -t "\${IMG}" .
|
|
53
|
+
podman build -t "\${IMG}" -f Dockerfile.\${ARCH} .
|
|
52
54
|
podman push --tls-verify=false "\${IMG}"
|
|
53
55
|
`;
|
|
54
56
|
const runTestScript = `
|
|
@@ -70,6 +72,10 @@ fi
|
|
|
70
72
|
|
|
71
73
|
oc logs test-hello-pod
|
|
72
74
|
`;
|
|
75
|
+
const factoryUrl = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED()
|
|
76
|
+
? FACTORY_TEST_CONSTANTS_1.FACTORY_TEST_CONSTANTS.TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL ||
|
|
77
|
+
'https://gh.crw-qe.com/test-automation-only/dockerfile-hello-world'
|
|
78
|
+
: FACTORY_TEST_CONSTANTS_1.FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/crw-qe/dockerfile-hello-world';
|
|
73
79
|
suiteSetup('Setup DevSpaces with container build capabilities enabled', function () {
|
|
74
80
|
kubernetesCommandLineToolsExecutor = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.KubernetesCommandLineToolsExecutor);
|
|
75
81
|
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
@@ -90,9 +96,8 @@ oc logs test-hello-pod
|
|
|
90
96
|
suiteSetup('Login into DevSpaces', async function () {
|
|
91
97
|
await loginTests.loginIntoChe();
|
|
92
98
|
});
|
|
93
|
-
test(
|
|
94
|
-
await
|
|
95
|
-
await workspaceHandlingTests.createAndOpenWorkspace('Empty Workspace');
|
|
99
|
+
test(`Create and open new workspace from: ${factoryUrl}`, async function () {
|
|
100
|
+
await workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
96
101
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
97
102
|
workspaceName = WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName();
|
|
98
103
|
(0, chai_1.expect)(workspaceName, 'Workspace name was not detected').not.empty;
|
|
@@ -101,6 +106,10 @@ oc logs test-hello-pod
|
|
|
101
106
|
test('Wait for workspace readiness', async function () {
|
|
102
107
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
103
108
|
});
|
|
109
|
+
test('Check the project files were imported', async function () {
|
|
110
|
+
const projectSection = await projectAndFileTests.getProjectViewSession();
|
|
111
|
+
(0, chai_1.expect)(await projectAndFileTests.getProjectTreeItem(projectSection, 'Dockerfile.x86_64'), 'Dockerfile not found in the project tree').not.undefined;
|
|
112
|
+
});
|
|
104
113
|
test('Build and push container image from workspace', function () {
|
|
105
114
|
kubernetesCommandLineToolsExecutor = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.KubernetesCommandLineToolsExecutor);
|
|
106
115
|
kubernetesCommandLineToolsExecutor.workspaceName = workspaceName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildPushRunPodmanContainerAPI.spec.js","sourceRoot":"","sources":["../../../specs/api/BuildPushRunPodmanContainerAPI.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;wEAQwE;AACxE,+BAA8B;AAC9B,qEAA8D;AAC9D,mEAA+D;AAC/D,6EAA0E;AAC1E,uFAAoF;AAGpF,8CAAyD;
|
|
1
|
+
{"version":3,"file":"BuildPushRunPodmanContainerAPI.spec.js","sourceRoot":"","sources":["../../../specs/api/BuildPushRunPodmanContainerAPI.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;wEAQwE;AACxE,+BAA8B;AAC9B,qEAA8D;AAC9D,mEAA+D;AAC/D,6EAA0E;AAC1E,uFAAoF;AAGpF,8CAAyD;AAOzD,mFAAgF;AAGhF,KAAK,CAAC,6CAA6C,yCAAmB,CAAC,gBAAgB,EAAE,EAAE;IAC1F,MAAM,mBAAmB,GAAwB,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,mBAAmB,CAAC,CAAC;IAC/F,MAAM,sBAAsB,GAA2B,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,sBAAsB,CAAC,CAAC;IACxG,MAAM,UAAU,GAAe,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,UAAU,CAAC,CAAC;IACpE,MAAM,eAAe,GAAoB,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,iBAAiB,GAAuB,+BAAY,CAAC,GAAG,CAAC,uBAAK,CAAC,aAAa,CAAC,CAAC;IACpF,MAAM,SAAS,GAAc,+BAAY,CAAC,GAAG,CAAC,yBA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AAC;QAC1M,MAAM,kBAAkB,GAAgB,aAAa,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAE1F,IAAA,aAAM,EAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,mEAAmE,CAAC,CAAC;IAClH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -6,6 +6,7 @@ const WorkspaceHandlingTests_1 = require("../../tests-library/WorkspaceHandlingT
|
|
|
6
6
|
const MochaHooks_1 = require("../MochaHooks");
|
|
7
7
|
const chai_1 = require("chai");
|
|
8
8
|
const BASE_TEST_CONSTANTS_1 = require("../../constants/BASE_TEST_CONSTANTS");
|
|
9
|
+
const FACTORY_TEST_CONSTANTS_1 = require("../../constants/FACTORY_TEST_CONSTANTS");
|
|
9
10
|
suite(`Check possibility to manage containers within a workspace with kubedock and podman ${BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function () {
|
|
10
11
|
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
|
|
11
12
|
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
|
|
@@ -15,6 +16,16 @@ suite(`Check possibility to manage containers within a workspace with kubedock a
|
|
|
15
16
|
const dashboard = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.Dashboard);
|
|
16
17
|
let kubernetesCommandLineToolsExecutor;
|
|
17
18
|
let workspaceName = '';
|
|
19
|
+
/**
|
|
20
|
+
* test requires the following files to be present in the workspace root:
|
|
21
|
+
* - A Dockerfile named Dockerfile.${ARCH} with content:
|
|
22
|
+
* FROM scratch
|
|
23
|
+
* COPY hello /hello
|
|
24
|
+
* CMD ["/hello"]
|
|
25
|
+
* - A compiled 'hello' binary, that prints "Hello from Kubedock!" to output.
|
|
26
|
+
*
|
|
27
|
+
* Used to build and run a container in a pod for verifying Podman functionality.
|
|
28
|
+
*/
|
|
18
29
|
const testScript = '# Enable Kubedock\n' +
|
|
19
30
|
'export KUBEDOCK_ENABLED=true\n' +
|
|
20
31
|
'echo KUBEDOCK_ENABLED\n' +
|
|
@@ -42,7 +53,10 @@ suite(`Check possibility to manage containers within a workspace with kubedock a
|
|
|
42
53
|
'export IMG="${REG}/${PROJECT}/hello:${DATE}"\n' +
|
|
43
54
|
'podman login --tls-verify=false --username ${USER} --password ${TKN} ${REG}\n' +
|
|
44
55
|
'podman run --rm ${IMG}';
|
|
45
|
-
const factoryUrl =
|
|
56
|
+
const factoryUrl = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED()
|
|
57
|
+
? FACTORY_TEST_CONSTANTS_1.FACTORY_TEST_CONSTANTS.TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL ||
|
|
58
|
+
'https://gh.crw-qe.com/test-automation-only/dockerfile-hello-world'
|
|
59
|
+
: FACTORY_TEST_CONSTANTS_1.FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/crw-qe/dockerfile-hello-world';
|
|
46
60
|
suiteSetup('Login', async function () {
|
|
47
61
|
await loginTests.loginIntoChe();
|
|
48
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KubedockPodmanTest.spec.js","sourceRoot":"","sources":["../../../specs/miscellaneous/KubedockPodmanTest.spec.ts"],"names":[],"mappings":";;AAWA,mEAA+D;AAC/D,qEAA8D;AAC9D,uFAAoF;AACpF,8CAAyD;AAGzD,+BAA8B;AAG9B,6EAA0E;
|
|
1
|
+
{"version":3,"file":"KubedockPodmanTest.spec.js","sourceRoot":"","sources":["../../../specs/miscellaneous/KubedockPodmanTest.spec.ts"],"names":[],"mappings":";;AAWA,mEAA+D;AAC/D,qEAA8D;AAC9D,uFAAoF;AACpF,8CAAyD;AAGzD,+BAA8B;AAG9B,6EAA0E;AAG1E,m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CAAC;QAC7D,MAAM,MAAM,GAAgB,kCAAkC,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;QAClG,IAAA,aAAM,EAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;QAC5E,MAAM,SAAS,GAAgB,kCAAkC,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;QACxG,IAAA,aAAM,EAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,yCAAyC,EAAE,KAAK;QAC7D,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;QAChC,MAAM,eAAe,CAAC,yBAAyB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,sCAAsC,EAAE,KAAK;QAC1D,MAAM,iBAAiB,CAAC,4BAA4B,CAAC,+CAAsB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,8BAA8B,EAAE;QAC7C,IAAA,qCAAwB,EAAC,EAAE,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC,CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-che/che-e2e",
|
|
3
|
-
"version": "7.102.0-next-
|
|
3
|
+
"version": "7.102.0-next-36ecc36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"mocha-junit-reporter": "^2.2.1",
|
|
55
55
|
"mocha-multi-reporters": "^1.5.1",
|
|
56
56
|
"monaco-page-objects": "3.9.1",
|
|
57
|
-
"prettier": "^3.0
|
|
57
|
+
"prettier": "^3.4.0",
|
|
58
58
|
"rimraf": "2.6.2",
|
|
59
59
|
"selenium-webdriver": "4.6.1",
|
|
60
60
|
"shelljs": "^0.8.5",
|
|
@@ -21,6 +21,8 @@ import { ShellString } from 'shelljs';
|
|
|
21
21
|
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
22
22
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
23
23
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
24
|
+
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
25
|
+
import { ViewSection } from 'monaco-page-objects';
|
|
24
26
|
|
|
25
27
|
suite(`Test podman build container functionality ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
26
28
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -37,6 +39,16 @@ suite(`Test podman build container functionality ${BASE_TEST_CONSTANTS.TEST_ENVI
|
|
|
37
39
|
let devSpacesNamespace: string = '';
|
|
38
40
|
let cheClusterName: string = '';
|
|
39
41
|
|
|
42
|
+
/**
|
|
43
|
+
* test requires the following files to be present in the workspace root:
|
|
44
|
+
* - A Dockerfile named Dockerfile.${ARCH} with content:
|
|
45
|
+
* FROM scratch
|
|
46
|
+
* COPY hello /hello
|
|
47
|
+
* CMD ["/hello"]
|
|
48
|
+
* - A compiled 'hello' binary, that prints "Hello from Kubedock!" to output.
|
|
49
|
+
*
|
|
50
|
+
* Used to build and run a container in a pod for verifying Podman functionality.
|
|
51
|
+
*/
|
|
40
52
|
const buildPushScript: string = `
|
|
41
53
|
export ARCH=$(uname -m)
|
|
42
54
|
export DATE=$(date +"%m%d%y")
|
|
@@ -45,19 +57,10 @@ export TKN=$(oc whoami -t)
|
|
|
45
57
|
export REG="image-registry.openshift-image-registry.svc:5000"
|
|
46
58
|
export PROJECT=$(oc project -q)
|
|
47
59
|
export IMG="\${REG}/\${PROJECT}/hello:\${DATE}"
|
|
48
|
-
|
|
49
|
-
# Create test directory and Dockerfile
|
|
50
|
-
mkdir -p /projects/dockerfile-test
|
|
51
|
-
cd /projects/dockerfile-test
|
|
52
|
-
|
|
53
|
-
cat > Dockerfile << EOF
|
|
54
|
-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
|
|
55
|
-
RUN echo "Hello from Kubedock!" > /hello.txt
|
|
56
|
-
CMD ["cat", "/hello.txt"]
|
|
57
|
-
EOF
|
|
60
|
+
cd $PROJECT_SOURCE
|
|
58
61
|
|
|
59
62
|
podman login --tls-verify=false --username "\${USER}" --password "\${TKN}" "\${REG}"
|
|
60
|
-
podman build -t "\${IMG}" .
|
|
63
|
+
podman build -t "\${IMG}" -f Dockerfile.\${ARCH} .
|
|
61
64
|
podman push --tls-verify=false "\${IMG}"
|
|
62
65
|
`;
|
|
63
66
|
|
|
@@ -81,6 +84,11 @@ fi
|
|
|
81
84
|
oc logs test-hello-pod
|
|
82
85
|
`;
|
|
83
86
|
|
|
87
|
+
const factoryUrl: string = BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED()
|
|
88
|
+
? FACTORY_TEST_CONSTANTS.TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL ||
|
|
89
|
+
'https://gh.crw-qe.com/test-automation-only/dockerfile-hello-world'
|
|
90
|
+
: FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/crw-qe/dockerfile-hello-world';
|
|
91
|
+
|
|
84
92
|
suiteSetup('Setup DevSpaces with container build capabilities enabled', function (): void {
|
|
85
93
|
kubernetesCommandLineToolsExecutor = e2eContainer.get(CLASSES.KubernetesCommandLineToolsExecutor);
|
|
86
94
|
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
@@ -108,9 +116,8 @@ oc logs test-hello-pod
|
|
|
108
116
|
await loginTests.loginIntoChe();
|
|
109
117
|
});
|
|
110
118
|
|
|
111
|
-
test(
|
|
112
|
-
await
|
|
113
|
-
await workspaceHandlingTests.createAndOpenWorkspace('Empty Workspace');
|
|
119
|
+
test(`Create and open new workspace from: ${factoryUrl}`, async function (): Promise<void> {
|
|
120
|
+
await workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
114
121
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
115
122
|
workspaceName = WorkspaceHandlingTests.getWorkspaceName();
|
|
116
123
|
expect(workspaceName, 'Workspace name was not detected').not.empty;
|
|
@@ -121,6 +128,11 @@ oc logs test-hello-pod
|
|
|
121
128
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
122
129
|
});
|
|
123
130
|
|
|
131
|
+
test('Check the project files were imported', async function (): Promise<void> {
|
|
132
|
+
const projectSection: ViewSection = await projectAndFileTests.getProjectViewSession();
|
|
133
|
+
expect(await projectAndFileTests.getProjectTreeItem(projectSection, 'Dockerfile.x86_64'), 'Dockerfile not found in the project tree').not.undefined;
|
|
134
|
+
});
|
|
135
|
+
|
|
124
136
|
test('Build and push container image from workspace', function (): void {
|
|
125
137
|
kubernetesCommandLineToolsExecutor = e2eContainer.get(CLASSES.KubernetesCommandLineToolsExecutor);
|
|
126
138
|
kubernetesCommandLineToolsExecutor.workspaceName = workspaceName;
|
|
@@ -21,6 +21,7 @@ import { ShellString } from 'shelljs';
|
|
|
21
21
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
22
22
|
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
23
23
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
24
|
+
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
24
25
|
|
|
25
26
|
suite(
|
|
26
27
|
`Check possibility to manage containers within a workspace with kubedock and podman ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
@@ -35,6 +36,16 @@ suite(
|
|
|
35
36
|
let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
|
|
36
37
|
let workspaceName: string = '';
|
|
37
38
|
|
|
39
|
+
/**
|
|
40
|
+
* test requires the following files to be present in the workspace root:
|
|
41
|
+
* - A Dockerfile named Dockerfile.${ARCH} with content:
|
|
42
|
+
* FROM scratch
|
|
43
|
+
* COPY hello /hello
|
|
44
|
+
* CMD ["/hello"]
|
|
45
|
+
* - A compiled 'hello' binary, that prints "Hello from Kubedock!" to output.
|
|
46
|
+
*
|
|
47
|
+
* Used to build and run a container in a pod for verifying Podman functionality.
|
|
48
|
+
*/
|
|
38
49
|
const testScript: string =
|
|
39
50
|
'# Enable Kubedock\n' +
|
|
40
51
|
'export KUBEDOCK_ENABLED=true\n' +
|
|
@@ -66,7 +77,10 @@ suite(
|
|
|
66
77
|
'podman login --tls-verify=false --username ${USER} --password ${TKN} ${REG}\n' +
|
|
67
78
|
'podman run --rm ${IMG}';
|
|
68
79
|
|
|
69
|
-
const factoryUrl: string =
|
|
80
|
+
const factoryUrl: string = BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED()
|
|
81
|
+
? FACTORY_TEST_CONSTANTS.TS_SELENIUM_AIRGAP_FACTORY_GIT_REPO_URL ||
|
|
82
|
+
'https://gh.crw-qe.com/test-automation-only/dockerfile-hello-world'
|
|
83
|
+
: FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/crw-qe/dockerfile-hello-world';
|
|
70
84
|
|
|
71
85
|
suiteSetup('Login', async function (): Promise<void> {
|
|
72
86
|
await loginTests.loginIntoChe();
|