Skip to content

test(e2e): gate the e2e suite behind the build tag the docs already promise - #14132

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:a4-gate-e2e-build-tag
Aug 27, 2026
Merged

test(e2e): gate the e2e suite behind the build tag the docs already promise#14132
glours merged 1 commit into
docker:mainfrom
ndeloof:a4-gate-e2e-build-tag

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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 in pkg/e2e carried the e2e build tag AGENTS.md documents — -tags e2e was 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

…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 docker-agent left a comment

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.

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.

@glours glours left a comment

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.

LGTM

@glours
glours merged commit 7af58e3 into docker:main Aug 27, 2026
90 of 93 checks passed
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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