test(e2e): gate the e2e suite behind the build tag the docs already promise - #14132
Conversation
…romise AGENTS.md documents 'Test unit: go test ./pkg/...' and 'E2E tests: go test -tags e2e ./pkg/e2e/'. Both statements were false: no file in pkg/e2e carried an e2e build constraint, so the -tags flag was a no-op and the 'unit' command actually launched the full e2e suite — requiring a Docker daemon and the locally built binary, creating and destroying containers, for up to 20 minutes. CI only avoided this by grepping e2e out of the package list (Dockerfile). Every *_test.go in pkg/e2e now carries //go:build e2e (merged with the existing !windows constraints), and the Makefile e2e targets pass the tag. The documented commands become true: - go test ./pkg/... -> pkg/e2e reports [no test files] - go test -tags e2e ./pkg/e2e -> runs the suite AGENTS.md now also states the daemon/binary prerequisites explicitly. Part of docker#14074 (A: the code misdescribes its own structure). Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
All 51 changed files were reviewed. The PR mechanically adds //go:build e2e to every _test.go file in pkg/e2e/ and updates the two Makefile targets (e2e-compose and e2e-compose-standalone) to pass the tag at test-run time.
Makefile changes are correct:
e2e-compose: adds-tags e2e— tests now compile and run only when the tag is present.e2e-compose-standalone: changes--tags=standalone→--tags=e2e,standalone— both tags are required for that mode, correctly ordered.
CI is unaffected: .github/workflows/ci.yml calls make e2e-compose and make e2e-compose-standalone, which are both updated. No direct go test invocations of pkg/e2e exist in CI that would need updating.
Non-test helpers are untagged by design: framework.go, scenario.go, assert.go, checks.go carry no build tag so the package always compiles; e2e_config_plugin.go (!standalone) and e2e_config_standalone.go (standalone) keep their existing mode-selection logic untouched.
No bugs found.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
go test ./pkg/...used to launch the whole e2e suite (requiring a daemon and a built binary for up to 20 minutes) because no file inpkg/e2ecarried thee2ebuild tag AGENTS.md documents —-tags e2ewas a no-op. Every test file is now gated; non-test helpers stay untagged so the package always compiles. Makefile targets pass the tag; CI behavior is unchanged.Epic #14074, section A — split out of #14075 for focused review.
🤖 Generated with Claude Code