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

Create a test for checking a workspace with parent functionality #22506

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

musienko-maxim
Copy link
Contributor

@musienko-maxim musienko-maxim commented Sep 11, 2023

What does this PR do?

Automate the scenario described in the issue: https://issues.redhat.com/browse/CRW-4653

Screenshot/screencast of this PR

https://gitlab.cee.redhat.com/codeready-workspaces/test-cases/-/blob/master/tests/functional/git/m52-test-workspace-with-devfile-which-uses-the-parent.md

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-4653

How to test this PR?

Set up a test infra with the DevSpaces v.3.8 or later. Set up USERSTORY=WorkpaseUsingParent and other dedicated envs for the test and run
An example with successful test:

npm run test

> @eclipse-che/[email protected] 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 =               DEBUG
TS_SELENIUM_OCP_USERNAME =            admin
TS_SELENIUM_W3C_CHROME_OPTION =       true
NODE_TLS_REJECT_UNAUTHORIZED =        0
TS_SELENIUM_EDITOR =                  che-code

> @eclipse-che/[email protected] tsc
> rm -rf ./dist && ./configs/sh-scripts/generateIndex.sh && tsc -p .

Generating index.ts file...
Warning: Cannot find any files matching pattern "dist/specs/WorkpaseUsingParent.spec.js"

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

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

      TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME: EmptyWorkspace
      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: true
      TS_SELENIUM_LOG_LEVEL: DEBUG
      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: WorkpaseUsingParent

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


  Workspace using a parent test suite
          ▼ BrowserTabsUtil.navigateTo - https://devspaces.apps.ocp412-mmusiie.crw-qe.com
          ▼ RegularUserOcpCheLoginPage.login
          ▼ OcpLoginPage.isIdentityProviderLinkVisible
          ▼ OcpLoginPage.waitAndClickOnLoginProviderTitle
          ▼ OcpLoginPage.waitOpenShiftLoginWelcomePage
          ▼ OcpLoginPage.enterUserNameOpenShift - "admin"
          ▼ OcpLoginPage.enterPasswordOpenShift
          ▼ OcpLoginPage.clickOnLoginButton
          ▼ OcpLoginPage.waitDisappearanceOpenShiftLoginWelcomePage
          ▼ OcpLoginPage.isAuthorizeOpenShiftIdentityProviderPageVisible
          ▼ BrowserTabsUtil.maximize - TS_SELENIUM_LAUNCH_FULLSCREEN is set to true, maximizing window.
          ▼ Dashboard.waitStartingPageLoaderDisappearance
    ✔ Login (16813ms)
          ▼ Dashboard.waitPage
          ▼ BrowserTabsUtil.navigateTo - https://devspaces.apps.ocp412-mmusiie.crw-qe.com/dashboard/#https://github.com/testsfactory/parentDevfile
      • WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - obtained workspace name from workspace loader page: sample-using-parent
          ▼ registerRunningWorkspace - with workspaceName:sample-using-parent
          ▼ ProjectAndFileTests.waitWorkspaceReadinessForCheCodeEditor - ProjectAndFileTests.waitWorkspaceReadinessForCheCodeEditor - Waiting for editor.
          ▼ ProjectAndFileTests.waitWorkspaceReadinessForCheCodeEditor - ProjectAndFileTests.waitWorkspaceReadinessForCheCodeEditor - editor was opened in 27943 seconds.
          ▼ ProjectAndFileTests.performTrustAuthorDialog - trustedProjectDialog.pushButton: "Yes, I trust the authors"
    ✔ Create a workspace using a parent (34844ms)
    ✔ Check cloning of the test project (2115ms)
    ✔ Check devfile VS Code tasks  (5829ms)
          ▼ ShellExecutor.executeCommand - oc get pods --selector=controller.devfile.io/devworkspace_name=sample-using-parent --output jsonpath='{.items[0].metadata.name}'
workspace87fbc405d80d43d4-7d49d49d6f-q8ldz          ▼ ShellExecutor.executeCommand - oc get pod workspace87fbc405d80d43d4-7d49d49d6f-q8ldz --output jsonpath='{.spec.containers[*].name}'
tools che-gateway          ▼ ShellExecutor.executeCommand - oc get pod workspace87fbc405d80d43d4-7d49d49d6f-q8ldz --output jsonpath='{.spec.initContainers[].name}'
che-code-injector    ✔ Check expected containers in the parent POD (3439ms)
          ▼ ShellExecutor.executeCommand - oc exec -i workspace87fbc405d80d43d4-7d49d49d6f-q8ldz -c tools -- sh -c env
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13133_TCP_PROTO=tcp
NVM_DIR=/home/user/.nvm
SECONDS_OF_DW_RUN_BEFORE_IDLING=-1
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_8080_TCP_PROTO=tcp
HTTPD_DATA_ORIG_PATH=/var/www
PHP_SYSCONF_PATH=/etc
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13131_TCP_PROTO=tcp
NODEJS_HOME_16=/home/user/.nvm/versions/node/v16.14.0
DEVWORKSPACE_CREATOR=4965fa71-5122-4e46-ad9e-158d00970365
HTTPD_DATA_PATH=/var/www
NODEJS_HOME_14=/home/user/.nvm/versions/node/v14.19.0
NODEJS_HOME_12=/home/user/.nvm/versions/node/v12.22.10
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13133_TCP=tcp://172.30.65.255:13133
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_8080_TCP_ADDR=172.30.138.52
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13133_TCP_PROTO=tcp
HOSTNAME=workspace87fbc405d80d43d4-7d49d49d6f-q8ldz
SDKMAN_CANDIDATES_API=https://api.sdkman.io/2
KUBECONFIG=/home/user/.kube/config
MAVEN_HOME=/home/user/.sdkman/candidates/maven/current
WORKSPACE87FBC405D80D43D4_SERVICE_SERVICE_HOST=172.30.65.255
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13132_TCP=tcp://172.30.138.52:13132
RUSTUP_HOME=/home/user/.rustup
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_8080_TCP_PORT=8080
CHE_PLUGIN_REGISTRY_INTERNAL_URL=http://plugin-registry.openshift-devspaces.svc:8080/v3
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13133_TCP_PORT=13133
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13132_TCP_ADDR=172.30.138.52
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_PORT_WS_ROUTE=3030
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_PORT=3030
JAVA_HOME=/home/user/.sdkman/candidates/java/current
KUBEDOCK_VERSION=0.13.0
DEVWORKSPACE_NAME=sample-using-parent
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13132_TCP_PORT=13132
PHP_HTTPD_CONF_FILE=php.conf
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_3030_TCP_PROTO=tcp
KAMEL_VERSION=1.11.0
HTTPD_VAR_RUN=/var/run/httpd
NODEJS_14_VERSION=14.19.0
CHE_PLUGIN_REGISTRY_URL=https://devspaces.apps.ocp412-mmusiie.crw-qe.com/plugin-registry/v3
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP_ADDR=172.30.0.1
container=oci
CHE_DASHBOARD_URL=https://devspaces.apps.ocp412-mmusiie.crw-qe.com
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_3030_TCP=tcp://172.30.65.255:3030
WORKSPACE87FBC405D80D43D4_SERVICE_SERVICE_PORT_CODE_REDIRECT_1=13131
WORKSPACE87FBC405D80D43D4_SERVICE_SERVICE_PORT_CODE_REDIRECT_3=13133
WORKSPACE87FBC405D80D43D4_SERVICE_SERVICE_PORT_CODE_REDIRECT_2=13132
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_8080_TCP=tcp://172.30.138.52:8080
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT=tcp://172.30.138.52:3030
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13132_TCP=tcp://172.30.65.255:13132
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13133_TCP_ADDR=172.30.65.255
KUBERNETES_PORT=tcp://172.30.0.1:443
GRADLE_HOME=/home/user/.sdkman/candidates/gradle/current
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13131_TCP=tcp://172.30.138.52:13131
DEVWORKSPACE_METADATA=/devworkspace-metadata
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_3030_TCP_PORT=3030
PWD=/projects
SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING=1800
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_3030_TCP=tcp://172.30.138.52:3030
DEVFILE_ENV_VAR=true
HOME=/home/user
OPENVSX_REGISTRY_URL=
HTTPD_VAR_PATH=/var
JAVA_HOME_8=/home/user/.sdkman/candidates/java/8.0.332-tem
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13133_TCP_ADDR=172.30.138.52
KUBERNETES_SERVICE_PORT_HTTPS=443
DEVWORKSPACE_NAMESPACE=admin-devspaces
WORKSPACE87FBC405D80D43D4_SERVICE_SERVICE_PORT_WS_ROUTE=3030
LOMBOK_VERSION=1.18.18
OC_VERSION=4.6
KUBERNETES_PORT_443_TCP_PORT=443
NODEJS_VERSION=16.14.0
PROJECT_SOURCE=/projects/parentdevfile
BUILDAH_ISOLATION=chroot
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13132_TCP_PROTO=tcp
CARGO_HOME=/home/user/.cargo
SDKMAN_DIR=/home/user/.sdkman
KUBERNETES_PORT_443_TCP=tcp://172.30.0.1:443
HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d
CLUSTER_CONSOLE_URL=https://console-openshift-console.apps.ocp412-mmusiie.crw-qe.com
TERM=xterm
WORKSPACE87FBC405D80D43D4_SERVICE_SERVICE_PORT=3030
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13131_TCP_ADDR=172.30.138.52
GRAALVM_HOME=/home/user/.sdkman/candidates/java/22.1.0.0.r17-mandrel
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_3030_TCP_PROTO=tcp
PARENT_ENV_VAR=true
WORKSPACE87FBC405D80D43D4_SERVICE_PORT=tcp://172.30.65.255:3030
NSS_SDB_USE_CACHE=no
SDKMAN_CANDIDATES_DIR=/home/user/.sdkman/candidates
_BUILDAH_STARTED_IN_USERNS=
PHP_VERSION=7.4
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13131_TCP=tcp://172.30.65.255:13131
CLUSTER_CONSOLE_TITLE=OpenShift console
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13132_TCP_PORT=13132
SHLVL=1
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13131_TCP_PROTO=tcp
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13131_TCP_PORT=13131
KUBERNETES_SERVICE_PORT=443
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_HOST=172.30.138.52
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_PORT_HELLO_GREETING_ENDPOINT=8080
JAVA_HOME_17=/home/user/.sdkman/candidates/java/17.0.3-tem
JAVA_HOME_11=/home/user/.sdkman/candidates/java/11.0.15-tem
DEVWORKSPACE_FLATTENED_DEVFILE=/devworkspace-metadata/flattened.devworkspace.yaml
DEVWORKSPACE_ORIGINAL_DEVFILE=/devworkspace-metadata/original.devworkspace.yaml
NODEJS_12_VERSION=12.22.10
DOTNET_RPM_VERSION=6.0
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13131_TCP_ADDR=172.30.65.255
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13133_TCP_PORT=13133
GOBIN=/home/user/go/bin/
PROJECTS_ROOT=/projects
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_13133_TCP=tcp://172.30.138.52:13133
WORKSPACE5F42F7BA009F4B89_SERVICE_PORT_3030_TCP_ADDR=172.30.138.52
DEVWORKSPACE_ID=workspace87fbc405d80d43d4
PATH=/home/user/.cargo/bin:/home/user/go/bin/:/home/user/.local/bin:/home/user/.nvm/versions/node/v16.14.0/bin:/home/user/.local/share/coursier/bin:/home/user/.sdkman/candidates/gradle/current/bin:/home/user/.sdkman/candidates/java/current/bin:/home/user/.sdkman/candidates/maven/current/bin:/home/user/.krew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HTTPD_MAIN_CONF_PATH=/etc/httpd/conf
SDKMAN_VERSION=5.13.0
DEVWORKSPACE_IDLE_TIMEOUT=15m
PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13132_TCP_PROTO=tcp
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_PORT_CODE_REDIRECT_1=13131
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_PORT_CODE_REDIRECT_2=13132
WORKSPACE5F42F7BA009F4B89_SERVICE_SERVICE_PORT_CODE_REDIRECT_3=13133
KUBERNETES_SERVICE_HOST=172.30.0.1
SDKMAN_PLATFORM=linuxx64
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13132_TCP_ADDR=172.30.65.255
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_3030_TCP_PORT=3030
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_13131_TCP_PORT=13131
DEVWORKSPACE_COMPONENT_NAME=tools
WORKSPACE87FBC405D80D43D4_SERVICE_PORT_3030_TCP_ADDR=172.30.65.255
HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d
_=/usr/bin/env
    ✔ Check expected environment variables (1888ms)

      • Context.stopTheDriver - Chrome driver session stopped.

  6 passing (1m)

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.

@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 Sep 11, 2023
Copy link
Member

@ScrewTSW ScrewTSW left a comment

Choose a reason for hiding this comment

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

a technical question

Copy link
Member

Choose a reason for hiding this comment

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

Why the sudden change in formatting of package.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apply a prettier formatter + change some version of vscode-extension-tester lib for correct interaction with some UI elements. But you are right it looks a bit strange. I'll take a look at the formatted part again and change it if it is incorrect

Copy link
Member

Choose a reason for hiding this comment

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

thank you for explanation and verification

Copy link
Member

Choose a reason for hiding this comment

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

nice, thank you for this implementation

@musienko-maxim musienko-maxim merged commit 8a0bacc into main Sep 18, 2023
2 checks passed
@musienko-maxim musienko-maxim deleted the CRW-4653 branch September 18, 2023 10:24
@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 Sep 18, 2023
import { Locators, ModalDialog } from 'monaco-page-objects';
import { CheCodeLocatorLoader } from '../pageobjects/ide/CheCodeLocatorLoader';

const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
Copy link
Contributor

Choose a reason for hiding this comment

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

class should be injected

Copy link
Contributor

Choose a reason for hiding this comment

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

);
expect(envList).contain('DEVFILE_ENV_VAR=true');
expect(envList).contain('PARENT_ENV_VAR=true');
});
Copy link
Contributor

Choose a reason for hiding this comment

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

should be logout to run few test specs at once

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented: #22544

const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
function executeArbitraryShellScript(command: string): string {
Copy link
Contributor

@nallikaea nallikaea Sep 19, 2023

Choose a reason for hiding this comment

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

better move to ShellExecutor class

import { ShellString } from 'shelljs';
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
import { registerRunningWorkspace } from '../MochaHooks';
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
Copy link
Contributor

Choose a reason for hiding this comment

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

constants should be declarated inside suit

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented: #22544

registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
// sometimes the trust dialog does not appear at first time, for avoiding this problem we send click event for activating
await new Workbench().click();
Copy link
Contributor

Choose a reason for hiding this comment

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

could it be inside projectAndFileTests.performTrustAuthorDialog() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented: #22544

await devFileTask?.click();
const firstExpectedQuickPick: QuickPickItem | undefined = await input.findQuickPick('1. This command from the devfile');
const secondExpectedQuickPick: QuickPickItem | undefined = await input.findQuickPick('2. This command from the parent');
expect(firstExpectedQuickPick).not.eqls(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

can be just .not.undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented: #22544


test('Check expected environment variables', function (): void {
const envList: string = executeArbitraryShellScript(
`${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} exec -i ${podName} -c tools -- sh -c env`
Copy link
Contributor

Choose a reason for hiding this comment

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

Shell we add it into KubernetesCommandLineToolsExecutor? Like getContainerEnvs()

Copy link
Contributor Author

@musienko-maxim musienko-maxim Sep 21, 2023

Choose a reason for hiding this comment

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

Usually, we do not use it in other tests. It is specific for this functionality. But if it repeats in other test parts - of course, it is better to extract it. My point is to avoid methods that will be used for one test. In this case, we do not overload KubernetesCommandLineToolsExecutor class.

expect(containerNames).contains('che-gateway');

const initContainerName: string = executeArbitraryShellScript(
`${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} --output jsonpath=\'{.spec.initContainers[].name}\'`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use is it getPodAndContainerNames() here also? mb with some updates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it makes sense to extract it if we use it regularly. But WorkpaseUsingParent.spec.ts test is pretty specific. These specific commands are used in this test. But if we get precedent to use the same command in future tests, it will be better to extract in a method.

});

test('Check expected containers in the parent POD', function (): void {
const getPodNameCommand: string = `${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pods --selector=controller.devfile.io/devworkspace_name=sample-using-parent --output jsonpath=\'{.items[0].metadata.name}\'`;
Copy link
Contributor

Choose a reason for hiding this comment

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

can`t check test suite locally because loginToOcp() method is missing.

Copy link
Contributor Author

@musienko-maxim musienko-maxim Sep 21, 2023

Choose a reason for hiding this comment

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

Well, I supposed if we run it on CI - it will be applied approach like in the PredefinedNamespaceTest: https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/basic/job/typescript-tests/12044/console, and mount kubeconfig directory: -v /home/hudson/.kube:/home/seluser/.kube:Z this file stores sessions with logins. And we do not need to do it in the test twice. If you want to check it locally, you can log in with oc client manually and run the test as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

it is additional manual steps to remember. method checks firstly if user already logged.
https://github.com/eclipse/che/blob/17b7a3e8e0e3138ddfadd95414a97e931e4667d0/tests/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts#L38C14-L38C14
in the PredefinedNamespaceTest we have login method after refactoring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied in the #22544

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.

5 participants