build: keep the image context clean instead of wiping the worktree

Every test target required 'clean', which is 'git clean -fdX .' - so running the unit tests deleted every git-ignored file the operator had, venv and caches included. It was compensating for a missing .dockerignore: the Dockerfile's COPY . . otherwise drags __pycache__, egg-info and build output into the image context.

The ignore file fixes that where it belongs, so the prerequisite can go. 'clean' remains available as its own target.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-18 01:44:12 +02:00
parent 37a07fe100
commit 03da186a06
2 changed files with 20 additions and 7 deletions

13
.dockerignore Normal file
View File

@@ -0,0 +1,13 @@
.git
.github
__pycache__
**/__pycache__
*.egg-info
**/*.egg-info
artifacts/
dist/
build/
.venv
.ruff_cache
.pytest_cache
.mcp.json

View File

@@ -51,19 +51,19 @@ ruff-fix: install-lint
lint: ruff lint: ruff
# clean + build run once and in order, then lint and the three suites run # build runs once, then lint and the three suites run concurrently via -j4; the
# concurrently via -j4; the *-run targets carry no clean/build prereq so the # *-run targets carry no build prereq so the sub-make cannot race a second build.
# sub-make cannot race a second clean against build. # `clean` is deliberately not a prerequisite; .dockerignore keeps the image
# context clean instead.
test: test:
@$(MAKE) clean
@$(MAKE) build @$(MAKE) build
@$(MAKE) -j4 lint test-unit-run test-integration-run test-e2e-run @$(MAKE) -j4 lint test-unit-run test-integration-run test-e2e-run
test-unit: clean build test-unit-run test-unit: build test-unit-run
test-integration: clean build test-integration-run test-integration: build test-integration-run
test-e2e: clean build test-e2e-run test-e2e: build test-e2e-run
test-unit-run: test-unit-run:
@echo ">> Running unit tests" @echo ">> Running unit tests"