-
Notifications
You must be signed in to change notification settings - Fork 0
Add integration test suite with real Postgres and Redis #20
Copy link
Copy link
Open
Description
Summary
All tests use in-memory stores or mocks. There are no integration tests that exercise the real Postgres repository or Redis runtime store, or that test end-to-end flows through the full stack.
Current state
- Postgres repository tested with pgxmock (SQL-level mocking)
- Redis runtime store tested with miniredis
- No test exercises the real Postgres query planner, transaction behavior, or constraint enforcement
- No end-to-end test: session creation → grant request → approval → proxy execution → revocation
- No test for cleanup worker against real persistence
Required work
- Add testcontainers-based integration tests for Postgres repository (real Postgres instance, apply migrations, run full CRUD)
- Add testcontainers-based integration tests for Redis runtime store (real Redis instance, test budget enforcement under concurrency)
- Add end-to-end integration test: full flow from session creation through grant issuance to proxy execution and cleanup
- Add concurrent access tests: multiple goroutines issuing grants, executing proxies, and revoking sessions simultaneously
- Tag integration tests with
//go:build integrationso they don't run in basic CI (add a separate CI job for integration tests) - Add load test for budget enforcement: many concurrent proxy requests against a single handle
Files
- New test files in
internal/store/postgres/,internal/store/redis/,internal/app/ .github/workflows/ci.yml— add integration test job with Postgres and Redis services
Priority
Low-medium — mocks cover logic but miss real database behavior.
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels