Skip to content

fix(docker): make the compose test path import the package and find the scripts - #101

Merged
rennf93 merged 1 commit into
masterfrom
fix/docker-test-path
Oct 21, 2026
Merged

rennf93 merged 1 commit into
masterfrom
fix/docker-test-path

Conversation

@rennf93

@rennf93 rennf93 commented Oct 21, 2026

Copy link
Copy Markdown
Member

make test (the compose test service, pytest -v --cov=guard_core_mcp --cov-branch) gave 7 errors on master, on Python 3.10 and 3.14. It gives 157 passed here.

This repo tracks uv.lock (git ls-files uv.lock prints it), so --frozen and the lock mount are right and stay.

  1. The package was not importable in the test container (ModuleNotFoundError: No module named 'guard_core_mcp', 6 errors). The Dockerfile copies the package after uv sync, so the project was never installed in the image and nothing put /app on sys.path. I added uv pip install --python .venv/bin/python --no-deps -e /app after the copy, which is what guard-core's Dockerfile does.
  2. tests/test_sync_docs_script.py loads scripts/sync_docs.py, which the image did not contain (FileNotFoundError, 1 error). The Dockerfile now copies scripts/.

Verification, the compose test service run as the Makefile runs it, own compose project, master vs this branch:

  • Python 3.10: master 7 errors; branch 157 passed.
  • Python 3.14: master 7 errors; branch 157 passed.

Not verified: Python versions other than 3.10 and 3.14, hadolint cleanliness of this Dockerfile (it already had the apt and pip findings on master and I did not touch them), and the CI result (see the checks on this PR).

@rennf93 rennf93 added the no-issue Chore or dependency PR that does not need an issue label Oct 21, 2026
@github-actions github-actions Bot added the build Makefile / Docker / packaging label Oct 21, 2026
@rennf93
rennf93 merged commit 6f4b8b2 into master Oct 21, 2026
15 checks passed
@rennf93
rennf93 deleted the fix/docker-test-path branch October 22, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Makefile / Docker / packaging no-issue Chore or dependency PR that does not need an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant