Repository navigation
fix(docker): make the compose test path pass without a lockfile or a localhost Redis - #89
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.uv.lockis gitignored in this repo (git ls-files uv.lockprints nothing), but the Dockerfile ranuv sync --extra dev --frozenandcompose.ymlbind-mounted./uv.lock. On a clean clone the build failed withUnable to find lockfileand, once the file was missing, Docker created a directory calleduv.lockon the host and the mount failed withnot a directory. I copied the guard-core pattern:uv sync --extra devwithout--frozenand nouv.lockmount.tests/test_adapter_flask.pyandtests/test_adapter_django.pybuiltSecurityConfigfor the agent smoke tests without aredis_url, so the middleware connected to the defaultlocalhost:6379, which does not exist in the test container (3 failures on master). They now passredis_urlfromREDIS_URL, the way the conftest does. I kept Redis enabled on purpose: these tests are the only ones that reachSyncGuardAgentClient.initialize_redis(guard_agent/client.py:201), so switching Redis off, my first attempt, dropped the CI coverage gate to 99.96%.test_console_handler_emits_only_without_host_handlersassertedhandler.filter(record) is True. Since Python 3.12Handler.filterreturns the record instead ofTrue, 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:
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).