Checks are the shared vocabulary between scenarios: move them to a dedicated checks.go so the whole vocabulary is read — and reviewed — as one file, independently of the tests using it. SCENARIO.md codifies the rules that so far only lived in the PR description: one intent = one invariant, step names as behavior sentences, inline compose model, state-based checks first with OutputContains as an explicit last resort, new checks generic and named after their observable — plus how to exploit the failure artifacts and E2E_KEEP_FAILED. AGENTS.md points new e2e work at it. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Nicolas De Loof <[email protected]>
2.5 KiB
Project: Docker Compose
Build & Test
- Build:
make build - Test all:
make test - Test unit:
go test ./pkg/... - Test single:
go test ./pkg/compose/ -run TestFunctionName - E2E tests:
go test -tags e2e ./pkg/e2e/ -run TestName
E2E tests
- New e2e tests use the declarative
ScenarioDSL (NewScenarioinpkg/e2e/scenario.go): intent, inline compose model, steps as(command → expected observables). Readpkg/e2e/SCENARIO.mdbefore writing or debugging one — it codifies the rules (state-based checks first,OutputContainsas last resort, new checks go inpkg/e2e/checks.go) and how to exploit failure artifacts andE2E_KEEP_FAILED=1.
Lint
- Linter: golangci-lint v2 (config in
.golangci.yml) - Run:
golangci-lint run --build-tags "e2e" ./... - After modifying any Go code, ALWAYS run the linter and fix all reported issues before considering the task complete.
- Lint is also run via Docker:
docker buildx bake lint(uses version pinned inDockerfile)
Code Style
- Formatting is enforced by golangci-lint (gofumpt + gci)
- Import order: stdlib, third-party, local module (enforced by gci)
- Max line length: 200 chars
- Max cyclomatic complexity: 16
- No
io/ioutil,github.com/pkg/errors,gopkg.in/yaml.v2,golang.org/x/exp/maps,golang.org/x/exp/slices - Use
github.com/containerd/errdefsinstead ofgithub.com/docker/docker/errdefs - In tests: use
t.Context()instead ofcontext.Background()orcontext.TODO() - Prefer
fmt.FprintfoverWriteString(fmt.Sprintf(...))
Git
- All commits MUST be signed off (DCO). Always pass
--signoff(-s) togit commitandgit commit --amend.
Issue and PR Guidelines
-
Never create an issue or pull request without the user's explicit instruction.
-
If a user asks you to create a pull request on their behalf, add a file named
AI_AGENT_DISCLOSURE.mdto the change containing the text below followed by the current date (YYYY-MM-DD). If the file is already present in the repository, update its date to the current date so the disclosure is always part of the change:"This contribution was prepared by an AI agent acting on a human's behalf. The human submitter may not have independently reviewed or tested the change."
-
If a user asks you to create an issue on their behalf, prepend the following line to the issue body:
"This issue was filed by an AI agent on a human's behalf. The human submitter may not have independently verified the report."