test(e2e): add Podman provider e2e test parity with Docker#284
Conversation
Add 15 missing Docker e2e test scenarios to both rootless and rootful Podman contexts, bringing Podman test coverage to parity with Docker for all tests that don't require Docker SDK types.
📝 WalkthroughWalkthroughThis PR expands e2e test coverage for the Podman provider by adding lifecycle command and configuration/feature validation tests for both rootless and rootful Podman modes, including assertions for command execution order, deferred execution, IDE accessibility timing, secrets injection, variable substitution, config merging, and custom image handling. ChangesPodman e2e test coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for devsydev canceled.
|
The docker-remote-env-null testdata uses a Dockerfile build that fails with Podman's buildah backend in CI. Remove the test from both rootless and rootful contexts until the build issue is resolved.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e/tests/up/provider_podman.go`:
- Around line 124-126: The current line-count logic uses lines :=
strings.Count(strings.TrimSpace(out), "\n") + 1 which returns 1 for an empty
string and can false-pass; update the assertion to first check for an empty
trimmed out (e.g., if strings.TrimSpace(out) == "" then treat lines as 0 or fail
the test), otherwise compute lines by splitting on "\n" and counting non-empty
entries, and then assert the expected count; modify the checks around the
variable out (the lines calculation and the gomega.Expect call) in
provider_podman.go so empty logs do not report as one line.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 44b5b47d-286b-4a57-8919-d1abb1473595
📒 Files selected for processing (1)
e2e/tests/up/provider_podman.go
| lines := strings.Count(strings.TrimSpace(out), "\n") + 1 | ||
| gomega.Expect(lines).To(gomega.Equal(1), | ||
| "postStartCommand should have run once after initial up") |
There was a problem hiding this comment.
Line counting can false-pass when the log is empty.
At Line 124 and Line 758, strings.Count(strings.TrimSpace(out), "\n") + 1 evaluates to 1 for out == "", so the assertion can pass even if postStartCommand never wrote anything.
✅ Suggested fix
- out, err := f.DevsySSH(ctx, tempDir, "cat $HOME/post-start-count.log")
- framework.ExpectNoError(err)
- lines := strings.Count(strings.TrimSpace(out), "\n") + 1
+ out, err := f.DevsySSH(ctx, tempDir, "cat $HOME/post-start-count.log")
+ framework.ExpectNoError(err)
+ trimmed := strings.TrimSpace(out)
+ gomega.Expect(trimmed).NotTo(gomega.BeEmpty())
+ lines := len(strings.Split(trimmed, "\n"))
gomega.Expect(lines).To(gomega.Equal(1),
"postStartCommand should have run once after initial up")
...
- out, err = f.DevsySSH(ctx, tempDir, "cat $HOME/post-start-count.log")
- framework.ExpectNoError(err)
- lines = strings.Count(strings.TrimSpace(out), "\n") + 1
+ out, err = f.DevsySSH(ctx, tempDir, "cat $HOME/post-start-count.log")
+ framework.ExpectNoError(err)
+ trimmed = strings.TrimSpace(out)
+ gomega.Expect(trimmed).NotTo(gomega.BeEmpty())
+ lines = len(strings.Split(trimmed, "\n"))
gomega.Expect(lines).To(gomega.Equal(2),
"postStartCommand should have run again after restart")Also applies to: 136-138, 758-760, 770-772
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@e2e/tests/up/provider_podman.go` around lines 124 - 126, The current
line-count logic uses lines := strings.Count(strings.TrimSpace(out), "\n") + 1
which returns 1 for an empty string and can false-pass; update the assertion to
first check for an empty trimmed out (e.g., if strings.TrimSpace(out) == "" then
treat lines as 0 or fail the test), otherwise compute lines by splitting on "\n"
and counting non-empty entries, and then assert the expected count; modify the
checks around the variable out (the lines calculation and the gomega.Expect
call) in provider_podman.go so empty logs do not report as one line.
Summary
docker.DockerHelper.Inspectwith Docker SDK types (existing running container, security options, custom workspace mount, workspace mount consistency, overrideCommand default, id-label) are intentionally omitted from Podman as they cannot be implemented without the prohibited importsCloses DEVSY-100
Summary by CodeRabbit