18 Commits
Author SHA1 Message Date
Nicolas De Loof 7af58e3626 test(e2e): gate the e2e suite behind the build tag the docs already promise
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 <[email protected]>
2026-08-27 11:02:07 +02:00
Guillaume Lours 3a62ae63ce fix(ps): honor psFormat from Docker CLI config when no --format flag given
The --format flag defaulted to "table" instead of "", so the
opts.Format == "" guard in runPs never fired for a bare compose ps.
Setting the default to "" lets the existing config-fallback path work,
matching the behaviour of docker ps.

Fixes #13643
Supersedes #14032

Signed-off-by: Guillaume Lours <[email protected]>
2026-08-20 14:05:34 +02:00
Guillaume Lours 8e0d5e17a7 fix: make e2e tests pass reliably locally with Docker Desktop
- Fix stale image/container reuse across test runs                                                                                                                                                                                                                                                          - Add registry readiness check and async removal polling
  - Skip multi-arch test when docker driver supports it
  - Use t.Cleanup for reliable teardown, fix project name mismatches
  - Re-enable 4 previously skipped tests that now pass

Signed-off-by: Guillaume Lours <[email protected]>
2026-05-18 10:55:41 +02:00
Sebastiaan van Stijn 92a7ac1fa2 fix mixed assertion libraries in tests
Before this, assertion libraries were mixed, sometimes
even in the same file.

    git grep -l '"gotest.tools/v3/' | wc -l
    75
    git grep -l '"github.com/stretchr/testify' | wc -l
    24

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-03-31 17:32:51 +02:00
Nicolas De Loof 2b4543935c next release will be major version v5.x
Signed-off-by: Nicolas De Loof <[email protected]>
2025-11-13 09:32:43 +01:00
Nicolas De Loof d70bb8cf5e distinguish event (short) status text and details
Signed-off-by: Nicolas De Loof <[email protected]>
2025-11-04 10:18:55 +01:00
Sebastiaan van Stijn 6f1f76c0e6 pkg/e2e: fix contains: use assert.Contains (testifylint)
pkg/e2e/ps_test.go:50:5: contains: use assert.Contains (testifylint)
                    assert.True(t, strings.Contains(line, "127.0.0.1:8001->8000/tcp"))
                    ^
    pkg/e2e/ps_test.go:54:5: contains: use assert.Contains (testifylint)
                    assert.True(t, strings.Contains(line, "80/tcp, 443/tcp, 8080/tcp"))
                    ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2025-02-10 17:03:36 +01:00
Matthieu MOREL 11e9621da5 ci: enable testifylint linter
Signed-off-by: Matthieu MOREL <[email protected]>
2024-11-12 11:12:32 +01:00
Nicolas De Loof a1de0b96c3 Restore Project is ps json output
Signed-off-by: Nicolas De Loof <[email protected]>
2023-11-24 10:46:33 +01:00
Nicolas De Loof 41682acc77 add support for attributes exposed by docker ps
Signed-off-by: Nicolas De Loof <[email protected]>
2023-08-25 16:36:45 +02:00
Nicolas De Loof 1054792b47 align docker compose ps with docker CLI to support --format
Signed-off-by: Nicolas De Loof <[email protected]>
2023-08-25 16:36:45 +02:00
Nicolas De Loof 9bd9f1765c check service names based on project, not running containers
Signed-off-by: Nicolas De Loof <[email protected]>
2022-12-21 21:11:44 +01:00
Nicolas De Loof e42673daed only list running containers when --all=false
Signed-off-by: Nicolas De Loof <[email protected]>
2022-12-16 21:46:55 +01:00
Nicolas De Loof 8c39b5b7fd align --format flag and UX with docker cli
Signed-off-by: Nicolas De Loof <[email protected]>
2022-12-14 22:53:43 +01:00
Milas Bowman 152c2d9a33 e2e: fix spurious ps failures
Use the command `stdout` instead of combined `stdout` + `stderr`
for assertions to avoid failures from any CLI logging such as
warnings, which will be on `stderr`.

Signed-off-by: Milas Bowman <[email protected]>
2022-06-16 11:28:29 -04:00
Milas Bowman d9065050fd e2e: fix subtests and block parallel unsafe tests
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 <[email protected]>
2022-06-15 16:27:30 -04:00
Nick Sieger ebb45b400c e2e: unmarshal json into container summaries
Signed-off-by: Nick Sieger <[email protected]>
2022-06-08 15:13:31 -05:00
Nick Sieger c83133f73b e2e: add test for ps
Signed-off-by: Nick Sieger <[email protected]>
2022-06-08 14:05:20 -05:00