Repository navigation
fix(docker): make the compose test path pass without a lockfile or a localhost Redis - #173
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.
make test(the compose test service,pytest -v --cov=guard --cov-branch) gave 41 failed 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.SecurityConfigdefaults toenable_redis=Trueandredis_url=redis://localhost:6379. Tests that build a config without aredis_urltherefore connect tolocalhost:6379inside the test container, where no Redis listens, and the middleware answers 503. Tests that hardcoded the URL now readREDIS_URLthe way the conftest does, and a session fixture intests/conftest.pypoints the engine default atREDIS_URLwhen it is set (it does nothing whenREDIS_URLis unset, so the CI service container on localhost still works). Files:tests/test_decorators/test_middleware_integration.py,tests/test_middleware/test_redis_unavailable_response.py,tests/conftest.py.Verification, the compose test service run as the Makefile runs it, in an own compose project with Redis without a host port (the Makefile target itself runs
docker compose down --rmi all -vanddocker system prune -f, so I did not run it), master vs this branch:uv.lock, because master does not build without one.compose.ymlon this branch:healthy,GET /200,uid=10001(Python 3.10).Not verified: Python versions other than 3.10 and 3.14, and the CI result (see the checks on this PR).