feat(tests): add optional PostgreSQL integration test target - #133
feat(tests): add optional PostgreSQL integration test target#133tomkabel wants to merge 5 commits into
Conversation
- Adds user_id and optional email to access token payload - Maintains sub claim for backward compatibility - Binds request_id to structlog contextvars for correlation
- Replace reset_stuck_jobs with requeue_stuck_jobs in main loop - Zombie sweeper now writes outbox entry atomically with status update - Avoids dual-write problem when Redis is unavailable - Decouples outbox sync interval from cleanup (default 30s)
- Support TEST_DATABASE_URL override for real PostgreSQL tests - Add test-db and test-redis services to docker-compose.test.yml - Add postgres hatch script for integration testing - Keep per-worker SQLite as fast default
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 34 minutes and 36 seconds.Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Adds an optional PostgreSQL integration test target alongside the existing per-worker SQLite setup, enabling tests against a real database engine before production deployment.
Changes
Test Configuration (
tests/conftest.py)TEST_DATABASE_URLenvironment variable when setDocker Compose (
docker-compose.test.yml)test-db— PostgreSQL 15 Alpine with health check and resource limitstest-redis— Redis 7 Alpine with health check and resource limits127.0.0.1for loopback-only accessHatch Scripts (
pyproject.toml)postgresscript: runs full suite against PostgreSQL viaTEST_DATABASE_URLpostgresalongsidesqliteUsage
Motivation
SQLite in-memory is fast but doesn't catch PostgreSQL-specific behavior (e.g., constraint ordering, SERIAL vs UUID,
RETURNINGclause differences). Running the full suite against PostgreSQL before merging catches these integration issues.Testing
Labels
testing