## Summary Auth has zero tests (`find backend/auth -name 'test_*.py'` returns nothing). Unacceptable for a service that issues credentials. ## Changes - `backend/auth/tests/unit/` — password hashing, JWT sign/verify with rotation (https://github.com/PlaceBrain/auth/issues/7), OTP generation and verification. - `backend/auth/tests/integration/` — testcontainers Postgres + Redis + Kafka: - Register → SendOtp → VerifyOtp → Login → RefreshTokens → Logout. - DeleteUser (https://github.com/PlaceBrain/auth/issues/6) and verify `UserDeleted` emitted. - Revocation list enforcement (https://github.com/PlaceBrain/auth/issues/8). - `pyproject.toml` — add `pytest`, `pytest-asyncio`, `testcontainers`, `pytest-cov` to dev group. - Wire into CI via https://github.com/PlaceBrain/workflows/issues/2 once that lands; until then runs locally via `uv run pytest`. ## Verification - `uv run pytest --cov=src --cov-fail-under=70` is green locally and in CI.
Summary
Auth has zero tests (
find backend/auth -name 'test_*.py'returns nothing). Unacceptable for a service that issues credentials.Changes
backend/auth/tests/unit/— password hashing, JWT sign/verify with rotation (feat(security): JWT signing key rotation with kid header #7), OTP generation and verification.backend/auth/tests/integration/— testcontainers Postgres + Redis + Kafka:UserDeletedemitted.pyproject.toml— addpytest,pytest-asyncio,testcontainers,pytest-covto dev group.uv run pytest.Verification
uv run pytest --cov=src --cov-fail-under=70is green locally and in CI.