Repository navigation
fix(docker): make the compose test path and the example run - #47
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=.) did not run on a clean clone of master (theuv.lockmount failed), and on 3.14 it had one failing test. It gives 0 failed here. The compose example service starts.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.uv sync, so the project was never installed in the image and nothing put/apponsys.path. I addeduv pip install --python .venv/bin/python --no-deps -e /appafter the copy, which is what guard-core's Dockerfile does. The compose example runspython examples/simple_app/main.py, which failed withNo module named 'tornadoapi_guard'for that reason.tests/test_middleware_unit.pyhardcodedredis_url="redis://localhost:6379"in two places and now readsREDIS_URLthe way the conftest does. All other tests in this repo already pass an explicit config, so no conftest fixture was needed.test_init_with_blocked_countries_sets_geoippassed aMagicMockasgeo_ip_handler.SecurityConfigvalidates that field against a runtime-checkable protocol (GeoIPHandler), which on 3.12 and later looks attributes up statically and does not accept a bare mock. The test uses a realIPInfoManager.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); branch 91 passed, 0 failed.compose.yml:healthy,GET /200,uid=10001.Not verified: Python versions other than 3.10 and 3.14, and the CI result (see the checks on this PR).