| Level | Location | Tools | Coverage Goal |
|---|---|---|---|
| Unit (many, fast) | src/backend/tests/unit/ |
pytest, Vitest | >80% |
| Integration (some) | src/backend/tests/integration/ |
pytest, Docker | Key flows |
| Security | tests/security/ |
sqlmap, OWASP ZAP, custom payloads | OWASP Top 10 |
| Performance | benchmarks/ |
wrk, k6, Locust | <20% WAF overhead |
- SQL Injection: >95% detection rate
- XSS: >95% detection rate
- Path Traversal: >95% detection rate
- False positive rate: <10%
The M1 smoke test starts the Docker Compose stack, waits for healthy services, checks that a benign request is allowed, checks that a SQL injection request is blocked by Coraza, and then tears the stack down.
Prerequisites:
- Docker with Docker Compose
deploy/docker/.envcreated fromdeploy/docker/.env.example- The CRS submodule initialised with
git submodule update --init --recursive
Run locally:
bash benchmarks/smoke/e2e.shThe smoke test sends Host: app.local because the reference HAProxy
configuration rejects unknown hosts before WAF inspection. The same smoke test
also runs nightly and on demand through .github/workflows/smoke.yml.
- Payloads:
benchmarks/payloads/(sqli.txt, xss.txt, legitimate.txt) - Results:
benchmarks/results/(timestamped JSON, gitignored)
See README.commands.md for all test commands.
For frontend work, use pnpm as the only package manager.