Include Loyalty/Communication/Sports Center backends and registry updates alongside production nginx and compose wiring. Co-authored-by: Cursor <cursoragent@cursor.com>
1.4 KiB
1.4 KiB
Testing Strategy
Required Layers
| Layer | Purpose |
|---|---|
| Unit | Pure domain logic, validators, mappers |
| Service | Business rules with DB/fakes |
| Repository | Query correctness, tenant filters |
| API | HTTP contracts, authz, status codes |
| Integration | Multi-component flows (onboarding, OTP, SSO handoff) |
| Migration | Upgrade/downgrade smoke on clean DB |
| Tenant | Cross-tenant isolation negatives |
| Performance | Hot entitlement/resolve paths as needed |
| Security | Auth bypass attempts, token scope checks |
| Architecture | Boundary rules (optional lint/CI later) |
| Documentation validation | Links, registry completeness for the phase |
Rules
- New behavior ships with tests in the same phase.
- Tenant tests must include at least one cross-tenant denial case for new tenant-scoped APIs.
- Do not rely on production data for assertions.
- Prefer deterministic time/OTP fakes.
- Phase is incomplete if tests fail or are absent for claimed deliverables.
Commands (current)
cd backend/core-service
pytest -q
cd backend/services/identity-access
pytest -q