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 #14074 (A: the code misdescribes its own structure).
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
- TestExposeRange keeps its regression link (#13378), the invariant
being simply that up accepts a port range in expose.
- TestUpContainerNameConflict interpolates a project-scoped
container_name instead of the fixture's global 'test', so parallel
runs cannot collide on it.
- TestIPC demonstrates the CLI() escape hatch: the external container
the 'container:' mode points at is created eagerly before the steps,
so its id is available to the declarative checks. (Runs only in CI:
ipc container: mode is rejected by Docker Desktop and dind daemons —
'restricted host mount' — for the legacy test as well.)
- wait scenarios observe which services exited instead of trusting the
command's silence; TestWaitOnInfinity stays legacy, the DSL has no
notion of a still-running command. The wait fixture stays for it;
ipc-test and container_name fixtures are removed.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
The big mechanical change here is to NOT store `t` as a field on
the `CLI` object (which has been renamed as well to fix the odd
capitalization). The way the tests are structured meant that the
"subtests" were using the _parent_ `*testing.T` instance, which
causes various oddities including confusing messages on failure
about a child test causing a panic in the parent.
Additionally, a few tests have been blocked from running in
parallel because they are sharing `compose.yaml` fixtures and
can fail as a result (e.g. due to a port conflict on the host).
I'll fix these in follow-up PRs but want to focus on correctness
for the tests before optimizing them.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>