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

[Test] Added 'BuildContainerAPI' to API tests #23377

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

martinszuc
Copy link
Contributor

@martinszuc martinszuc commented Mar 5, 2025

What does this PR do?

This PR adds a new test that verifies container build capabilities inside DevSpaces workspaces. The test builds a container image in a workspace using podman, pushes it to the internal registry, and then verifies the image can be run as a pod in the cluster.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

[CRW-7588] Fix Dev Spaces "Test podman build and push container image" script to avoid using an absolute devfile registry

How to test this PR?

run the test with

export NODE_TLS_REJECT_UNAUTHORIZED=0
export TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=htpasswd
export TS_SELENIUM_BASE_URL=
export TS_SELENIUM_OCP_PASSWORD=
export TS_SELENIUM_OCP_USERNAME=
export TS_SELENIUM_VALUE_OPENSHIFT_OAUTH=true
export USERSTORY=BuildContainerAPI

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.

@martinszuc martinszuc force-pushed the CRW-7588 branch 5 times, most recently from 5c664e4 to a435744 Compare March 5, 2025 19:16
martinszuc added a commit to martinszuc/che that referenced this pull request Mar 5, 2025
Signed-off-by: Martin Szuc <mszuc@redhat.com>
@SkorikSergey SkorikSergey added area/qe kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Mar 6, 2025
@dmytro-ndp dmytro-ndp requested a review from SkorikSergey March 6, 2025 18:03
@dmytro-ndp dmytro-ndp marked this pull request as ready for review March 6, 2025 18:16
@dmytro-ndp
Copy link
Contributor

@martinszuc : could you please share the test execution log for review (without exposing passwords, of course)?

I would also suggest renaming the test to reflect the full scope of the test scenario: BuildPushRunPodmanContainerAPI.

martinszuc added a commit to martinszuc/che that referenced this pull request Mar 7, 2025
Signed-off-by: Martin Szuc <mszuc@redhat.com>
@martinszuc
Copy link
Contributor Author

@dmytro-ndp @SkorikSergey I rebased the PR according to change requests.
I also changed the disableContainerBuildCapabilities to default to false if it was not found in yaml config. Can you please confirm this is a correct approach for newest versions?

@martinszuc
Copy link
Contributor Author

@martinszuc : could you please share the test execution log for review (without exposing passwords, of course)?

> @eclipse-che/che-e2e@7.100.0-next 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 =            omitted
TS_SELENIUM_W3C_CHROME_OPTION =       true
NODE_TLS_REJECT_UNAUTHORIZED =        0
TS_SELENIUM_EDITOR =                  che-code

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

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

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

      TS_SELENIUM_BASE_URL: https://devspaces.apps.ocp417-mszuc.crw-qe.com
      TS_SELENIUM_HEADLESS: false
      TS_SELENIUM_OCP_USERNAME:
      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: 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,Java Lombok,Quarkus REST API,Python,.NET,C/C++,Go,PHP,Ansible

      MOCHA_DIRECTORY is not set
      USERSTORY: BuildPushRunPodmanContainerAPI

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


            ‣ DriverHelper.getDriver
  Test podman build container functionality 
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - login to the "OC" client.
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.isUserLoggedIn - oc
          ▼ ShellExecutor.executeCommand - oc whoami && oc whoami --show-server=true
omitted
https://api.ocp417-mszuc.crw-qe.com:6443
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - user already logged
          ▼ ShellExecutor.executeCommand - oc get checluster --all-namespaces -o jsonpath="{.items[0].metadata.namespace}"
openshift-devspaces          ▼ ShellExecutor.executeCommand - oc get checluster -n openshift-devspaces -o jsonpath='{.items[0].metadata.name}'
devspaces          ▼ ShellExecutor.executeCommand - oc get checluster/devspaces -n openshift-devspaces -o jsonpath='{.spec.devEnvironments.disableContainerBuildCapabilities}'
true          ▼ ShellExecutor.executeCommand - oc patch checluster/devspaces -n openshift-devspaces --type=merge -p '{"spec":{"devEnvironments":{"disableContainerBuildCapabilities":false}}}'
checluster.org.eclipse.che/devspaces patched
          ▼ LoginTests.loginIntoChe
            ‣ BrowserTabsUtil.getCurrentUrl
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.navigateTo - https://devspaces.apps.ocp417-mszuc.crw-qe.com
            ‣ DriverHelper.navigateToUrl
            ‣ DriverHelper.getDriver
          ▼ Dashboard.waitPage
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - polling timed out attempt #1, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #2, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #3, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #4, retrying with 1000ms timeout
  [ERROR] DriverHelper.waitVisibility - failed with exception, out of attempts - TimeoutError: Waiting for element to be located By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
  Wait timed out after 1036ms
          ▼ LoginTests.loginIntoChe - try to login into application
          ▼ RegularUserOcpCheLoginPage.login
            ‣ DriverHelper.waitAndClick - By(xpath, //div[@class="panel-login"]/div[contains(@class, "panel-content")]/form/button)
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@class="panel-login"]/div[contains(@class, "panel-content")]/form/button)
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ OcpLoginPage.isIdentityProviderLinkVisible
            ‣ DriverHelper.waitVisibilityBoolean - By(xpath, //a[text()="htpasswd"])
            ‣ DriverHelper.isVisible - By(xpath, //a[text()="htpasswd"])
          ▼ OcpLoginPage.waitAndClickOnLoginProviderTitle
            ‣ DriverHelper.waitAndClick - By(xpath, //a[text()="htpasswd"])
            ‣ DriverHelper.waitVisibility - By(xpath, //a[text()="htpasswd"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ OcpLoginPage.waitOpenShiftLoginWelcomePage
            ‣ DriverHelper.waitVisibility - By(xpath, //*[contains(text(), "Welcome")])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ OcpLoginPage.enterUserNameOpenShift - "omitted"
            ‣ DriverHelper.enterValue - By(css selector, *[id="inputUsername"]) text: omitted
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.clear - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitAttributeValue - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitAndGetElementAttribute - By(css selector, *[id="inputUsername"]) attribute: 'value'
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.type - By(css selector, *[id="inputUsername"]) text: omitted
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitAttributeValue - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitAndGetElementAttribute - By(css selector, *[id="inputUsername"]) attribute: 'value'
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputUsername"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ OcpLoginPage.enterPasswordOpenShift
            ‣ DriverHelper.enterValue - By(css selector, *[id="inputPassword"]) text: ***
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.clear - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitAttributeValue - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitAndGetElementAttribute - By(css selector, *[id="inputPassword"]) attribute: 'value'
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.type - By(css selector, *[id="inputPassword"]) text: ***
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitAttributeValue - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitAndGetElementAttribute - By(css selector, *[id="inputPassword"]) attribute: 'value'
            ‣ DriverHelper.waitVisibility - By(css selector, *[id="inputPassword"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ OcpLoginPage.clickOnLoginButton
            ‣ DriverHelper.waitAndClick - By(css selector, button[type=submit])
            ‣ DriverHelper.waitVisibility - By(css selector, button[type=submit])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ OcpLoginPage.waitDisappearanceOpenShiftLoginWelcomePage
            ‣ DriverHelper.waitDisappearance - By(xpath, //*[contains(text(), "Welcome")])
            ‣ DriverHelper.waitDisappearanceBoolean - By(xpath, //*[contains(text(), "Welcome")])
            ‣ DriverHelper.isVisible - By(xpath, //*[contains(text(), "Welcome")])
          ▼ OcpLoginPage.isAuthorizeOpenShiftIdentityProviderPageVisible
            ‣ DriverHelper.isVisible - By(xpath, //h1[text()="Authorize Access"])
            ‣ BrowserTabsUtil.maximize
          ▼ BrowserTabsUtil.maximize - TS_SELENIUM_LAUNCH_FULLSCREEN is set to true, maximizing window.
            ‣ DriverHelper.getDriver
          ▼ Dashboard.waitStartingPageLoaderDisappearance
            ‣ DriverHelper.waitDisappearance - By(css selector, .main-page-loader)
            ‣ DriverHelper.waitDisappearanceBoolean - By(css selector, .main-page-loader)
            ‣ DriverHelper.isVisible - By(css selector, .main-page-loader)
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.isVisible - By(css selector, .main-page-loader)
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.isVisible - By(css selector, .main-page-loader)
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.isVisible - By(css selector, .main-page-loader)
            ‣ DriverHelper.wait - (1000 milliseconds)
          ▼ Dashboard.waitPage
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[text()="Create Workspace"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ Dashboard.clickWorkspacesButton
            ‣ DriverHelper.waitAndClick - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ Dashboard.waitPage
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[text()="Create Workspace"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ WorkspaceHandlingTests.createAndOpenWorkspace - fetching user kubernetes namespace, storing auth token by getting workspaces API URL.
          ▼ ApiUrlResolver.obtainUserNamespace
            ‣ ApiUrlResolver.obtainUserNamespace - USER_NAMESPACE.length = 0, calling kubernetes API
            ‣ DriverHelper.getDriver
(node:123175) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
          ▼ ApiUrlResolver.obtainUserNamespace - kubeapi success: admin-devspaces
          ▼ Dashboard.clickCreateWorkspaceButton
            ‣ DriverHelper.waitAndClick - By(xpath, //div[@id="page-sidebar"]//a[text()="Create Workspace"])
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[text()="Create Workspace"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ CreateWorkspace.waitPage
          ▼ CreateWorkspace.waitTitleContains - text: "Create Workspace"
            ‣ DriverHelper.waitVisibility - By(xpath, //h1[contains(text(), 'Create Workspace')])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ BrowserTabsUtil.getCurrentWindowHandle
            ‣ DriverHelper.getDriver
          ▼ CreateWorkspace.clickOnSampleNoEditorSelection - sampleName: "Empty Workspace"
            ‣ CreateWorkspace.getSampleLocator - sampleName: Empty Workspace, used default editor
            ‣ DriverHelper.waitAndClick - By(xpath, //article[contains(@class, 'sample-card')]//div[text()='Empty Workspace'])
            ‣ DriverHelper.waitVisibility - By(xpath, //article[contains(@class, 'sample-card')]//div[text()='Empty Workspace'])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ BrowserTabsUtil.waitAndSwitchToAnotherWindow
            ‣ DriverHelper.waitUntilTrue
          ▼ BrowserTabsUtil.getAllWindowHandles
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.getAllWindowHandles
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.switchToWindow
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - failed to obtain name from workspace start page, element not visible yet. Retrying.
            ‣ DriverHelper.wait - (1000 milliseconds)
            ‣ DriverHelper.getDriver
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - obtained starting workspace getText():Starting workspace empty-qp0i
            ‣ WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - trimmed workspace name from getText():empty-qp0i
      • WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage - obtained workspace name from workspace loader page: empty-qp0i
          ▼ registerRunningWorkspace - with workspaceName:empty-qp0i
    ✔ Create and open new Empty Workspace
          ▼ ProjectAndFileTests.waitWorkspaceReadinessForCheCodeEditor - waiting for editor.
            ‣ DriverHelper.waitVisibility - By(css selector, .monaco-workbench)
            ‣ DriverHelper.waitVisibility - polling timed out attempt #1, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #2, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #3, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #4, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #5, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #6, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #7, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #8, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #9, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #10, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #11, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #12, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #13, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #14, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #15, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #16, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #17, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #18, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #19, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #20, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #21, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #22, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #23, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #24, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - element is located and is visible.
          ▼ ProjectAndFileTests.waitWorkspaceReadinessForCheCodeEditor - editor was opened in 38699 seconds.
    ✔ Wait for workspace readiness (38699ms)
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - login to the "OC" client.
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.isUserLoggedIn - oc
          ▼ ShellExecutor.executeCommand - oc whoami && oc whoami --show-server=true
omitted
https://api.ocp417-mszuc.crw-qe.com:6443
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - user already logged
          ▼ KubernetesCommandLineToolsExecutor.getPodAndContainerNames - oc
          ▼ KubernetesCommandLineToolsExecutor.getWorkspacePodName - oc - get workspace pod name.
          ▼ ShellExecutor.executeCommand - oc get pod -l controller.devfile.io/devworkspace_name=empty-qp0i -n admin-devspaces -o name
pod/workspace2041d1c2d1014bde-955ffb777-4f269
          ▼ KubernetesCommandLineToolsExecutor.getContainerName - oc - get container name.
          ▼ ShellExecutor.executeCommand - oc get pod/workspace2041d1c2d1014bde-955ffb777-4f269 -o jsonpath='{.spec.containers[*].name}' -n admin-devspaces
universal-developer-image che-gateway

          ▼ KubernetesCommandLineToolsExecutor.execInContainerCommand - oc
          ▼ ShellExecutor.executeCommand - oc exec -i -t pod/workspace2041d1c2d1014bde-955ffb777-4f269 -n admin-devspaces -c universal-developer-image che-gateway -- sh -c '
          export ARCH=$(uname -m)
          export DATE=$(date +"%m%d%y")
          export USER=$(oc whoami)
          export TKN=$(oc whoami -t)
          export REG="image-registry.openshift-image-registry.svc:5000"
          export PROJECT=$(oc project -q)
          export IMG="${REG}/${PROJECT}/hello:${DATE}"
          
          # Create test directory and Dockerfile
          mkdir -p /projects/dockerfile-test
          cd /projects/dockerfile-test
          
          cat > Dockerfile << EOF
          FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
          RUN echo "Hello from Kubedock!" > /hello.txt
          CMD ["cat", "/hello.txt"]
          EOF
          
          podman login --tls-verify=false --username "${USER}" --password "${TKN}" "${REG}"
          podman build -t "${IMG}" .
          podman push --tls-verify=false "${IMG}"
          '
Unable to use a TTY - input is not a terminal or the right kind of file
Login Succeeded!
STEP 1/3: FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
Trying to pull registry.access.redhat.com/ubi8/ubi-minimal:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob sha256:495b67f206d50d81414a47cc50e03efb582f1d4653a0dd94890a2588c4603d7f
Copying config sha256:23ee77c122cc64976b431b2eb11274c5e7b7a0f56ebb790828626bd7677a0d50
Writing manifest to image destination
Storing signatures
STEP 2/3: RUN echo "Hello from Kubedock!" > /hello.txt
--> 2ae03e096504
STEP 3/3: CMD ["cat", "/hello.txt"]
COMMIT image-registry.openshift-image-registry.svc:5000/admin-devspaces/hello:030725
--> 30552768c622
Successfully tagged image-registry.openshift-image-registry.svc:5000/admin-devspaces/hello:030725
30552768c622e4f1c45391f26716b07449bc80bf0e43c386a89fd43f721c5a89
Getting image source signatures
Copying blob sha256:51a05ba8ffc200b3f595f46e9ced4861b15b031f506ddb1253777ac084bf2f0e
Copying blob sha256:ad97743f34d72da1437dc086ff52c2e9a6a4379213b70d860c4adfc5d1f62828
Copying config sha256:30552768c622e4f1c45391f26716b07449bc80bf0e43c386a89fd43f721c5a89
Writing manifest to image destination
    ✔ Build and push container image from workspace
          ▼ KubernetesCommandLineToolsExecutor.execInContainerCommand - oc
          ▼ ShellExecutor.executeCommand - oc exec -i -t pod/workspace2041d1c2d1014bde-955ffb777-4f269 -n admin-devspaces -c universal-developer-image che-gateway -- sh -c '
          export DATE=$(date +"%m%d%y")
          export REG="image-registry.openshift-image-registry.svc:5000"
          export PROJECT=$(oc project -q)
          export IMG="${REG}/${PROJECT}/hello:${DATE}"
          
          oc delete pod test-hello-pod --ignore-not-found
          oc run test-hello-pod --restart=Never --image="${IMG}"
          
          for i in {1..10}; do
            PHASE=$(oc get pod test-hello-pod -o jsonpath='{.status.phase}')
            if [[ "$PHASE" == "Succeeded" ]]; then
              break
            elif [[ "$PHASE" == "Failed" ]]; then
              oc describe pod test-hello-pod
              exit 1
            fi
            sleep 6
          done
          
          oc logs test-hello-pod
          '
Unable to use a TTY - input is not a terminal or the right kind of file
pod "test-hello-pod" deleted
pod/test-hello-pod created
Hello from Kubedock!
    ✔ Verify container image can be used in a pod
          ▼ Dashboard.openDashboard
            ‣ DriverHelper.navigateToUrl
            ‣ DriverHelper.getDriver
          ▼ Dashboard.waitPage
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - polling timed out attempt #1, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[text()="Create Workspace"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ BrowserTabsUtil.closeAllTabsExceptCurrent
          ▼ BrowserTabsUtil.getAllWindowHandles
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.getCurrentWindowHandle
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.switchToWindow
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.switchToWindow
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.stopAndDeleteWorkspaceByName
          ▼ TestWorkspaceUtil.stopWorkspaceByName - empty-qp0i
          ▼ ApiUrlResolver.obtainUserNamespace
            ‣ ApiUrlResolver.obtainUserNamespace - USER_NAMESPACE.length = 0, calling kubernetes API
            ‣ DriverHelper.getDriver
          ▼ ApiUrlResolver.obtainUserNamespace - kubeapi success: admin-devspaces
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.waitWorkspaceStatus
          ▼ ApiUrlResolver.obtainUserNamespace - admin-devspaces
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.stopWorkspaceByName - empty-qp0i stopped successfully
          ▼ TestWorkspaceUtil.deleteWorkspaceByName - empty-qp0i
          ▼ ApiUrlResolver.obtainUserNamespace - admin-devspaces
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.deleteWorkspaceByName - empty-qp0i deleted successfully
          ▼     at /home/mszuc/projects/che/tests/e2e/specs/MochaHooks.ts:39:12 - delete workspace name
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - login to the "OC" client.
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.isUserLoggedIn - oc
          ▼ ShellExecutor.executeCommand - oc whoami && oc whoami --show-server=true
omitted
https://api.ocp417-mszuc.crw-qe.com:6443
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - user already logged
          ▼ ShellExecutor.executeCommand - oc patch checluster/devspaces -n openshift-devspaces --type=merge -p '{"spec":{"devEnvironments":{"disableContainerBuildCapabilities":true}}}'
checluster.org.eclipse.che/devspaces patched


  4 passing (2m)

@martinszuc martinszuc requested a review from dmytro-ndp March 7, 2025 13:29
martinszuc added a commit to martinszuc/che that referenced this pull request Mar 7, 2025
Signed-off-by: Martin Szuc <mszuc@redhat.com>
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

Signed-off-by: Martin Szuc <mszuc@redhat.com>
@martinszuc
Copy link
Contributor Author

I provide output for verifying the test pod with oc wait :

 ▼ KubernetesCommandLineToolsExecutor.execInContainerCommand - oc
          ▼ ShellExecutor.executeCommand - oc exec -i -t pod/workspacef4bde7573fad4cd6-66cdbc998-cppgs -n admin-devspaces -c universal-developer-image che-gateway -- sh -c '
          export DATE=$(date +"%m%d%y")
          export REG="image-registry.openshift-image-registry.svc:5000"
          export PROJECT=$(oc project -q)
          export IMG="${REG}/${PROJECT}/hello:${DATE}"
          
          oc delete pod test-hello-pod --ignore-not-found
          oc run test-hello-pod --restart=Never --image="${IMG}"
          
          if ! oc wait --for=jsonpath='{.status.phase}'=Succeeded pod/test-hello-pod --timeout=60s; then
            PHASE=$(oc get pod test-hello-pod -o jsonpath='{.status.phase}')
            if [[ "$PHASE" == "Failed" ]]; then
              oc describe pod test-hello-pod
              exit 1
            fi
          fi
          
          oc logs test-hello-pod
          '
Unable to use a TTY - input is not a terminal or the right kind of file
pod "test-hello-pod" deleted
pod/test-hello-pod created
pod/test-hello-pod condition met
Hello from Kubedock!
    ✔ Verify container image can be used in a pod
          ▼ Dashboard.openDashboard
            ‣ DriverHelper.navigateToUrl
            ‣ DriverHelper.getDriver
          ▼ Dashboard.waitPage
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[contains(text(), "Workspaces (")])
            ‣ DriverHelper.waitVisibility - polling timed out attempt #1, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - polling timed out attempt #2, retrying with 1000ms timeout
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ DriverHelper.waitVisibility - By(xpath, //div[@id="page-sidebar"]//a[text()="Create Workspace"])
            ‣ DriverHelper.waitVisibility - element is located and is visible.
            ‣ BrowserTabsUtil.closeAllTabsExceptCurrent
          ▼ BrowserTabsUtil.getAllWindowHandles
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.getCurrentWindowHandle
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.switchToWindow
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
          ▼ BrowserTabsUtil.switchToWindow
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.stopAndDeleteWorkspaceByName
          ▼ TestWorkspaceUtil.stopWorkspaceByName - empty-2j4l
          ▼ ApiUrlResolver.obtainUserNamespace
            ‣ ApiUrlResolver.obtainUserNamespace - USER_NAMESPACE.length = 0, calling kubernetes API
            ‣ DriverHelper.getDriver
          ▼ ApiUrlResolver.obtainUserNamespace - kubeapi success: admin-devspaces
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.waitWorkspaceStatus
          ▼ ApiUrlResolver.obtainUserNamespace - admin-devspaces
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.stopWorkspaceByName - empty-2j4l stopped successfully
          ▼ TestWorkspaceUtil.deleteWorkspaceByName - empty-2j4l
          ▼ ApiUrlResolver.obtainUserNamespace - admin-devspaces
            ‣ DriverHelper.getDriver
            ‣ DriverHelper.getDriver
          ▼ TestWorkspaceUtil.deleteWorkspaceByName - empty-2j4l deleted successfully
          ▼     at /home/mszuc/projects/che/tests/e2e/specs/MochaHooks.ts:39:12 - delete workspace name
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - login to the "OC" client.
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.isUserLoggedIn - oc
          ▼ ShellExecutor.executeCommand - oc whoami && oc whoami --show-server=true
omitted
https://api.ocp417-mszuc.crw-qe.com:6443
          ▼ KubernetesCommandLineToolsExecutor.getServerUrl - oc - get server api url.
          ▼ KubernetesCommandLineToolsExecutor.loginToOcp - oc - user already logged
          ▼ ShellExecutor.executeCommand - oc patch checluster/devspaces -n openshift-devspaces --type=merge -p '{"spec":{"devEnvironments":{"disableContainerBuildCapabilities":false}}}'
checluster.org.eclipse.che/devspaces patched (no change)


  4 passing (2m)



@SkorikSergey SkorikSergey merged commit e4e067d into eclipse-che:main Mar 10, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qe kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants