Skip to content

Verify image build functionality using kubedock and podman when spec.devEnvironments.persistUserHome.enabled is set to true#23786

Merged
dmytro-ndp merged 4 commits intoeclipse-che:mainfrom
SkorikSergey:kubedock-podman-persist-user-home
Mar 30, 2026
Merged

Verify image build functionality using kubedock and podman when spec.devEnvironments.persistUserHome.enabled is set to true#23786
dmytro-ndp merged 4 commits intoeclipse-che:mainfrom
SkorikSergey:kubedock-podman-persist-user-home

Conversation

@SkorikSergey
Copy link
Copy Markdown
Contributor

What does this PR do?

Add a new E2E test to verify image build functionality using kubedock and podman when spec.devEnvironments.persistUserHome.enabled is set to true in the CheCluster.

Test Coverage

The new test (KubedockPodmanPersistUserHomeTest.spec.ts) covers P03 scenario:

  • Enables persistUserHome in CheCluster before test execution
  • Creates workspace from dockerfile-hello-world sample
  • Builds and pushes container image using podman with kubedock
  • Runs the built container and verifies output
  • Restores original persistUserHome setting after test completion

Changes

  • Added new test file tests/e2e/specs/miscellaneous/KubedockPodmanPersistUserHomeTest.spec.ts

Test Plan

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/CRW-10596

How to test this PR?

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.

@SkorikSergey SkorikSergey changed the title Add E2E test for Podman/Kubedock with persistUserHome enabled Add a new E2E test to verify image build functionality using kubedock and podman when spec.devEnvironments.persistUserHome.enabled is set to true Mar 27, 2026
@SkorikSergey SkorikSergey changed the title Add a new E2E test to verify image build functionality using kubedock and podman when spec.devEnvironments.persistUserHome.enabled is set to true Verify image build functionality using kubedock and podman when spec.devEnvironments.persistUserHome.enabled is set to true Mar 27, 2026

suiteTeardown(function (): void {
// restore spec.devEnvironments.persistUserHome.enabled to original value
shellExecutor.executeCommand(
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Mar 29, 2026

Choose a reason for hiding this comment

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

The test doesn't fail when oc patch command fails, which leaves patched config the same silently.

Possible fix:

const restoreResult: ShellString = shellExecutor.executeCommand(
    `oc patch checluster ${cheClusterName} --type=merge ` +
        `-p '{"spec":{"devEnvironments":{"persistUserHome":{"enabled": ${defaultPersistentHomeValue}}}}}'`
);                                                                                  

expect(restoreResult.code).to.equal(0, 'Failed to restore CheCluster persistUserHome setting');

defaultPersistentHomeValue = currentValue === 'true';

// set spec.devEnvironments.persistUserHome.enabled to true
shellExecutor.executeCommand(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test doesn't fail when oc patch command fails silently, making subsequent test failures harder to diagnose.

Possible fix:

const patchResult: ShellString = shellExecutor.executeCommand(                                                                                                                              
    `oc patch checluster ${cheClusterName} --type=merge ` +                                                                                                                                 
        '-p \'{"spec":{"devEnvironments":{"persistUserHome":{"enabled": true}}}}\''                                                                                                         
);                                                                                                                                                                                          
expect(patchResult.code).to.equal(0, 'Failed to patch CheCluster to enable persistUserHome'); 

Copy link
Copy Markdown
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.

The test looks generally good, but there is still room for improvement.

Copy link
Copy Markdown
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.

@SkorikSergey: thank you for taking review feedback into account.

Well done!

@dmytro-ndp dmytro-ndp merged commit 5531154 into eclipse-che:main Mar 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants