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>
Most files already grouped imports into "stdlib -> other -> local",
but some files didn't. The gci formatter is similar to goimports, but
has better options to make sure imports are grouped in the expected
order (and to make sure no additional groups are present).
This formatter has a 'fix' function, so code can be re-formatted auto-
matically;
golangci-lint run -v --fix
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Run `down` before and after test to not leave around containers
* Kill the `wait` process that's waiting on `infinity`
* NOTE: If the test is actually working, this should exit once
the `down` happens, but this ensures that we kill everything
we start
I'd like to generalize more of this into the framework, but this
is a quick fix to prevent filling up CI machines with tons of
processes over time.
Signed-off-by: Milas Bowman <milas.bowman@docker.com>