Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod and container overrides via attribute API tests #22195

Merged
merged 3 commits into from
May 3, 2023

Conversation

nallikaea
Copy link
Contributor

@nallikaea nallikaea commented May 3, 2023

What does this PR do?

This PR implements two regression test cases which check this functionality #944
Test case details: https://docs.google.com/document/d/1McSbXA6sjy7MPDu2pLxKdgulTVkvGt-0SNawEsvV7-s/edit

Screenshot/screencast of this PR

Log:

/usr/bin/npm run driver-less-test

> @eclipse-che/che-e2e@7.66.0-SNAPSHOT driver-less-test
> export TS_USE_WEB_DRIVER_FOR_TEST=false && npm run test


> @eclipse-che/che-e2e@7.66.0-SNAPSHOT test
> ./configs/sh-scripts/initDefaultValues.sh npm run lint && npm run tsc && export USERSTORY=$USERSTORY && mocha --config dist/configs/mocharc.js

Initialized default values

TS_SELENIUM_VALUE_TLS_SUPPORT =       
TS_SELENIUM_VALUE_OPENSHIFT_OAUTH =   true
TS_OCP_LOGIN_PAGE_PROVIDER_TITLE =    htpasswd
E2E_OCP_CLUSTER_VERSION =             4.x
TS_SELENIUM_LOG_LEVEL =               TRACE
TS_SELENIUM_OCP_USERNAME =            admin
TS_SELENIUM_W3C_CHROME_OPTION =       true
NODE_TLS_REJECT_UNAUTHORIZED =        0
TS_SELENIUM_EDITOR =                  che-code

> @eclipse-che/che-e2e@7.66.0-SNAPSHOT tsc
> rm -rf ./dist && ./configs/sh-scripts/generateIndex.sh && tsc -p .

Generating index.ts file...

################## Launch Information ##################

      TS_SELENIUM_BASE_URL: https://devspaces.apps.ocp412-aws.crw-qe.com
      TS_SELENIUM_HEADLESS: false
      TS_SELENIUM_OCP_USERNAME: admin
      TS_SELENIUM_EDITOR:   che-code

      TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME: petclinic-dev-environment
      TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS: 1000
      TS_SELENIUM_REPORT_FOLDER: ./report
      TS_SELENIUM_EXECUTION_SCREENCAST: false
      DELETE_SCREENCAST_IF_TEST_PASS: true
      TS_SELENIUM_REMOTE_DRIVER_URL: 
      DELETE_WORKSPACE_ON_FAILED_TEST: false
      TS_SELENIUM_LOG_LEVEL: TRACE
      TS_SELENIUM_LAUNCH_FULLSCREEN: true

      TS_COMMON_DASHBOARD_WAIT_TIMEOUT: 5000
      TS_SELENIUM_START_WORKSPACE_TIMEOUT: 360000
      TS_WAIT_LOADER_PRESENCE_TIMEOUT: 60000

      TS_SAMPLE_LIST: Node.js MongoDB,Node.js Express

      MOCHA_DRIRECTORY is not set
      USERSTORY is not set

      to output timeout variables, set TS_SELENIUM_PRINT_TIMEOUT_VARIABLES to true
 ######################################################## 


            ‣ DriverHelper.getDriver
  Test defining container overrides via attribute.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc: Login to the "OC" client.
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc: Get server api url.
oc whoami && oc whoami --show-server=true
admin
https://api.ocp412-aws.crw-qe.com:6443
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc: Get server api url.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc: User already logged
          ▼ KubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile - oc:
oc apply -n admin-devspaces -f "/home/marynadolhalova/AquaProjects/che/tests/e2e/resources/container-overrides.yaml"
devworkspace.workspace.devfile.io/web-terminal-container-overrides created
sleep 5s
    ✔ Apply container-overrides sample as DewWorkspace with OC client (6373ms)
          ▼ KubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration - oc:
oc get dw web-terminal-container-overrides -n admin-devspaces -o yaml
    ✔ Check that fields are overridden in the Deployment for DewWorkspace (768ms)
          ▼ KubernetesCommandLineToolsExecutor.deleteDevWorkspace - oc: Delete 'web-terminal-container-overrides' workspace
oc patch dw web-terminal-container-overrides -n admin-devspaces -p '{ "metadata": { "finalizers": null }}' --type merge || true
devworkspace.workspace.devfile.io/web-terminal-container-overrides patched
oc delete dw web-terminal-container-overrides -n admin-devspaces || true
devworkspace.workspace.devfile.io "web-terminal-container-overrides" deleted
oc delete dwt che-code-web-terminal-container-overrides -n admin-devspaces || true
Error from server (NotFound): devworkspacetemplates.workspace.devfile.io "che-code-web-terminal-container-overrides" not found

  Test defining pod overrides via attribute.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc: Login to the "OC" client.
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc: Get server api url.
oc whoami && oc whoami --show-server=true
admin
https://api.ocp412-aws.crw-qe.com:6443
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc: Get server api url.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc: User already logged
          ▼ KubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile - oc:
oc apply -n admin-devspaces -f "/home/marynadolhalova/AquaProjects/che/tests/e2e/resources/pod-overrides.yaml"
devworkspace.workspace.devfile.io/code-latest-pod-overrides created
sleep 5s
    ✔ Apply pod-overrides sample as DewWorkspace with OC client (6678ms)
          ▼ KubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration - oc:
oc get dw code-latest-pod-overrides -n admin-devspaces -o yaml
    ✔ Check that fields are overridden in the Deployment for DewWorkspace (885ms)
          ▼ KubernetesCommandLineToolsExecutor.deleteDevWorkspace - oc: Delete 'code-latest-pod-overrides' workspace
oc patch dw code-latest-pod-overrides -n admin-devspaces -p '{ "metadata": { "finalizers": null }}' --type merge || true
devworkspace.workspace.devfile.io/code-latest-pod-overrides patched
oc delete dw code-latest-pod-overrides -n admin-devspaces || true
devworkspace.workspace.devfile.io "code-latest-pod-overrides" deleted
oc delete dwt che-code-code-latest-pod-overrides -n admin-devspaces || true
Error from server (NotFound): devworkspacetemplates.workspace.devfile.io "che-code-code-latest-pod-overrides" not found

  4 passing (21s)

            ‣ DriverHelper.wait (5000 milliseconds)

Process finished with exit code 0

What issues does this PR fix or reference?

devfile/devworkspace-operator#944
https://issues.redhat.com/browse/CRW-4224

How to test this PR?

export USERSTORY=PodOverridesAPI && npm run driver-less-test
export USERSTORY=ContainerOverridesAPI && npm run driver-less-test

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Maryna Dolhalova added 3 commits May 3, 2023 13:45
Signed-off-by: mdolhalo <mdolhalo@redhat.com>
Signed-off-by: mdolhalo <mdolhalo@redhat.com>
Signed-off-by: mdolhalo <mdolhalo@redhat.com>
@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. target/branch Indicates that a PR will be merged into a branch other than master. labels May 3, 2023
@nallikaea nallikaea self-assigned this May 3, 2023
Copy link
Contributor

@dmytro-ndp dmytro-ndp left a comment

Choose a reason for hiding this comment

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

looks good to merge

@musienko-maxim musienko-maxim merged commit 03ef436 into eclipse-che:main May 3, 2023
1 check passed
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 3, 2023
nallikaea added a commit to nallikaea/che that referenced this pull request May 9, 2023
* Pod and container overrides via attribute API tests
---------

Signed-off-by: mdolhalo <mdolhalo@redhat.com>
Co-authored-by: Maryna Dolhalova <mdolhalo@redhat.com>
nallikaea added a commit to nallikaea/che that referenced this pull request Jun 6, 2023
* Pod and container overrides via attribute API tests
---------

Signed-off-by: mdolhalo <mdolhalo@redhat.com>
Co-authored-by: Maryna Dolhalova <mdolhalo@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/branch Indicates that a PR will be merged into a branch other than master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants