test(e2e): migrate ctr tests to Ginkgo framework#480
test(e2e): migrate ctr tests to Ginkgo framework#480IrvingMg wants to merge 1 commit intourunc-dev:mainfrom
Conversation
✅ Deploy Preview for urunc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
6c49549 to
f1eeccf
Compare
Signed-off-by: Irving Mondragón <mirvingr@gmail.com>
f1eeccf to
cf996b0
Compare
|
The CI issue was due to cspell not recognizing newly imported package names like |
cmainas
left a comment
There was a problem hiding this comment.
Thank you @IrvingMg for the changes. I have only left a few comments - questions to better understand the changes.
However, one thing that it would be nice to have is to filter the tests as we were able to do so before (e.g. test_ctr_hvt which runs all the ctr tests for hvt). If I remember correctly, this was possible in ginkgo. with labels(?). Ideally, we would like to filter the tests based on the
- monitor
- guest
- test function
| err := pullAllImages(testCtr, images) | ||
| Expect(err).NotTo(HaveOccurred(), "Failed to pull ctr images") | ||
|
|
||
| DeferCleanup(func() { |
There was a problem hiding this comment.
Is there any specific difference between DeferCleanup and AfterAll.
| tool = newCtrTool(tc) | ||
| tool.setContainerID(tc.Name) | ||
|
|
||
| DeferCleanup(func() { |
There was a problem hiding this comment.
Is there a reason to defer the cleanup rather than having it after the check for the expected output?
| }) | ||
| }) | ||
|
|
||
| BeforeEach(func() { |
There was a problem hiding this comment.
Is there a reason to switch directories during a test? Maybe one would be a safeguard from accidentally messing up with the cwd.
| @@ -72,15 +71,15 @@ func getTestCases(testFunc string) []containerTestArgs { | |||
| case testNerdctl: | |||
| return nerdctlTestCases() | |||
| case testCtr: | |||
There was a problem hiding this comment.
Should we just remove testCtr entirely in the switch statement?
Description
Migrate the
ctre2e tests from the standard Go testing package to Ginkgo. As the first set of tests to migrate, this PR also sets up the initial Ginkgo integration:ginkgoandgomegatogo.mod.suite_test.go with the Ginkgo bootstrap..golangci.ymlto allow Ginkgo dot-imports in test files.Related issues
How was this tested?
--ginkgo.focus(3/16 pass, 13 skipped)Output samples
LLM usage
Claude Code (Opus 4.6)
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).