Skip to content

test(health): add readiness probe and schema integration tests [REN-83] - #110

Merged
Scott Graham (cheddarfox) merged 1 commit into
devfrom
REN-83-health-integration-tests
Mar 9, 2026
Merged

Scott Graham (cheddarfox) merged 1 commit into
devfrom
REN-83-health-integration-tests

Conversation

@cheddarfox

Copy link
Copy Markdown
Member

Summary

  • Add health endpoint integration tests for readiness probe (/api/v1/health/ready)
  • Test degraded state when Redis unavailable (natural test env behavior)
  • Test ready state with mocked Redis (unittest.mock.patch)
  • Validate response schemas for all health/version endpoints (expected keys present)
  • Extend coverage beyond existing basic 200-check tests in tests/test_health.py

Test plan

  • Tests cover /api/v1/health/ready endpoint (6 tests in TestReadinessProbe)
  • Degraded state verified without Redis
  • Ready state verified with mocked Redis
  • Response schema validation for /health, /api/v1/health, /version
  • ruff check passes
  • ruff format --check passes

Files changed

  • tests/integration/test_health.py (new, 168 lines, 10 tests)

🤖 Generated with Claude Code

Add tests/integration/test_health.py with 10 integration tests:

- Liveness probes: schema validation for /health and /api/v1/health
- Version endpoint: schema validation for /version
- Readiness probe: basic 200 check, database/redis key presence,
  degraded state without Redis, ready state with mocked Redis
- Content-Type validation for JSON responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cheddarfox

Copy link
Copy Markdown
Member Author

ARCHitect Review — REN-83 ✅ APPROVED

10 tests covering liveness, version, readiness (degraded+ready states). Mocked Redis for ready state test. Good coverage.

🤖 Generated with Claude Code

@cheddarfox
Scott Graham (cheddarfox) merged commit d5d21fd into dev Mar 9, 2026
15 of 17 checks passed
@cheddarfox
Scott Graham (cheddarfox) deleted the REN-83-health-integration-tests branch March 9, 2026 22:52
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