13 — Testing & Deployment¶
Testing Pyramid¶
| Layer | Tool | Coverage |
|---|---|---|
| Unit tests | pytest + factory-boy | 80% services, 70% routes, 60% integrations |
| Integration | pytest + async SQLite | Critical paths (tenant isolation, FHIR, auth) |
| Agent evals | Langfuse traces + manual review | ICD accuracy, match quality |
| BDD | behave | Happy path + GDPR + tenant isolation |
| E2E | Playwright | 3–5 critical user journeys |
| Snapshot | pytest | API response schema contracts |
Code Quality Gates¶
| Tool | Purpose | When |
|---|---|---|
| Ruff | Python linter + formatter (PEP-8) | save + pre-commit + CI |
| mypy | Static type checking (strict) | CI pre-merge |
| Bandit | Security linter | CI pre-merge |
| ESLint + Prettier | TS/React linting + formatting | save + CI |
| pre-commit | Block direct main commits | Every commit |
| commitlint | Conventional Commits format | Every commit |
Deployment Topology¶
| Component | Platform | URL | Deploy Trigger |
|---|---|---|---|
| Backend (FastAPI) | Railway Pro | services.curaway.ai | Push to main |
| Frontend (Vite/React) | Vercel | app.curaway.ai | Push to main |
| Docs (MkDocs Material) | GitHub Pages | docs.curaway.ai | Push to main |
| PostgreSQL | Railway (internal network) | Internal | Managed |
| Metabase OSS | Railway | Internal | Manual |
Local Development¶
- Docker Compose: PostgreSQL (5433), Redis (6380); cloud services remote
- Makefile:
make dev,make branch,make commit,make push,make deploy,make sync - 7 Claude Code subagents: compliance-reviewer, architecture-reviewer, test-writer, platform-integrity-checker, doc-generator, code-reviewer, orchestrator
Git Workflow¶
- Trunk-based: main is source of truth, feature branches max 2–3 days
- Naming: feat/, fix/, infra/, docs/ prefixes
- Merge: Squash only, protected main, CI must pass
- Post-merge sync:
git fetch origin && git reset --hard origin/main