Skip to content

fix(docker): make the compose test path pass without a lockfile or a localhost Redis - #89

Merged
rennf93 merged 2 commits into
masterfrom
fix/docker-test-path
Oct 21, 2026
Merged

rennf93 merged 2 commits into
masterfrom
fix/docker-test-path

Conversation

@rennf93

@rennf93 rennf93 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

The same Docker test path bugs as the adapters, found while checking guard-agent. make test (the compose test service, pytest -v --cov=.) gave 3 failed on Python 3.10 and 4 on 3.14 on master. It gives 0 failed here.

  1. uv.lock is gitignored in this repo (git ls-files uv.lock prints nothing), but the Dockerfile ran uv sync --extra dev --frozen and compose.yml bind-mounted ./uv.lock. On a clean clone the build failed with Unable to find lockfile and, once the file was missing, Docker created a directory called uv.lock on the host and the mount failed with not a directory. I copied the guard-core pattern: uv sync --extra dev without --frozen and no uv.lock mount.
  2. tests/test_adapter_flask.py and tests/test_adapter_django.py built SecurityConfig for the agent smoke tests without a redis_url, so the middleware connected to the default localhost:6379, which does not exist in the test container (3 failures on master). They now pass redis_url from REDIS_URL, the way the conftest does. I kept Redis enabled on purpose: these tests are the only ones that reach SyncGuardAgentClient.initialize_redis (guard_agent/client.py:201), so switching Redis off, my first attempt, dropped the CI coverage gate to 99.96%.
  3. Python 3.14 only: test_console_handler_emits_only_without_host_handlers asserted handler.filter(record) is True. Since Python 3.12 Handler.filter returns the record instead of True, so the test now asserts truthiness. The filter itself is unchanged.

Verification, the compose test service run as the Makefile runs it, own compose project, Redis without a host port, master vs this branch:

  • Python 3.10: master 542 passed, 2 skipped, 3 failed; branch 545 passed, 2 skipped, 0 failed.
  • Python 3.14: master 541 passed, 2 skipped, 4 failed; branch 545 passed, 2 skipped, 0 failed.
  • Master runs used a locally generated uv.lock, because master does not build without one.

Coverage: the CI form of the gate (pytest -v --cov=guard_agent --cov-fail-under=100) in the compose test service reports 100.00% on both Python 3.10 and 3.14.

Not verified: Python versions other than 3.10 and 3.14, 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 tests Test suite changes build Makefile / Docker / setup.py / packaging labels Oct 21, 2026
@rennf93
rennf93 merged commit d7af643 into master Oct 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Makefile / Docker / setup.py / packaging no-issue Chore or dependency PR that does not need an issue tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant