Add regression tests for redis/requests-cache version compatibility - #99
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.
Summary
Regression test for the redis-py/Redis-server version incompatibility that took down production on 2026-07-28 (fixed in #98).
census_extractomatic/test_redis_compat.pyspins up a realredis:5.0.7container (not a mock — required to reproduce the HELLO/protocol-version behavior), configuresrequirepass, connects via auser:pass@hostURL matching production's shape, and exercises the app's realflask_caching.Cache->cachelib->redis-pypath. Plus a guard test assertingredisstays explicitly pinned inPipfile.Verified catches the bug: passes with
redis==5.1.1; fails withredis==8.0.1, reproducing the exact production traceback (redis.exceptions.ResponseError: unknown command 'HELLO'...).Also added: a GitHub Actions workflow (
.github/workflows/test.yml) to actually run this on push/PR — neither repo had any CI before this. It installs the locked dependencies (minusgdal, which needs a matching systemlibgdalthe runner doesn't have — see note below) and runs the full test suite. Confirmed passing on a real GitHub Actions run.Known gap, not addressed here: this CI doesn't cover GDAL-dependent code (
census_extractomatic/api.py's full import chain, viauser_geo.py'sfrom osgeo import ogr), since that needs the systemlibgdalto match the pinned Pythongdalpackage version exactly (see the Dockerfile/Pipfile comments from the GDAL sync fix). None of the current tests touch that code path, so it wasn't blocking, but it's worth its own follow-up if test coverage expands into that area.Test plan
pytest census_extractomatic/test_aggregate_acs.py census_extractomatic/test_moe.py census_extractomatic/test_redis_compat.py(22/22 passing locally)redis==8.0.1and passes againstredis==5.1.1