Skip to content

Add regression tests for redis/requests-cache version compatibility - #99

Merged
iandees merged 2 commits into
masterfrom
test-redis-compat-regression
Jul 28, 2026
Merged

Add regression tests for redis/requests-cache version compatibility#99
iandees merged 2 commits into
masterfrom
test-redis-compat-regression

Conversation

@iandees

@iandees iandees commented Jul 28, 2026

Copy link
Copy Markdown
Member

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.py spins up a real redis:5.0.7 container (not a mock — required to reproduce the HELLO/protocol-version behavior), configures requirepass, connects via a user:pass@host URL matching production's shape, and exercises the app's real flask_caching.Cache -> cachelib -> redis-py path. Plus a guard test asserting redis stays explicitly pinned in Pipfile.

Verified catches the bug: passes with redis==5.1.1; fails with redis==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 (minus gdal, which needs a matching system libgdal the 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, via user_geo.py's from osgeo import ogr), since that needs the system libgdal to match the pinned Python gdal package 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)
  • Confirmed the new test fails against redis==8.0.1 and passes against redis==5.1.1
  • GitHub Actions workflow passing on a real run: https://github.com/censusreporter/census-api/actions/runs/30395519426

@iandees
iandees merged commit 7efa206 into master Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant