Testing Strategy
Unit Testing
| Service | Framework | Command | Coverage Target |
|---|---|---|---|
| Safekeys CLI | Go testing | go test ./apps/cli/... | 80% |
| Control Plane Database | Go testing with testcontainers | go test ./apps/control-plane/internal/store/... | 85% |
| Control Plane API | Go testing + testcontainers for Postgres | go test ./apps/control-plane/... | 80% |
| Safekeys MCP Server | vitest | npm test --workspace packages/mcp-server | 80% |
| Python SDK | pytest | pytest packages/sdk-python | 80% |
| Safekeys.ai Site | vitest | npm test --workspace apps/site | 70% |
| Sidecar / Resolver | Go testing | go test ./apps/sidecar/... | 80% |
| TypeScript SDK | vitest | npm test --workspace packages/sdk-typescript | 80% |
Acceptance Testing
Features declare 90 acceptance test(s) across 21 feature(s).
| Feature | Test Count |
|---|---|
| safekeys/audit-logging | 4 |
| safekeys/control-plane-api | 4 |
| safekeys/policy-engine | 4 |
| safekeys/deployment-packaging | 7 |
| safekeys/distribution | 6 |
| safekeys/docs-hosting | 6 |
| safekeys/hardware-root | 4 |
| safekeys/threshold-crypto | 4 |
| safekeys/integration-mcp-server | 3 |
| safekeys/integration-python-sdk | 4 |
| safekeys/secret-creation | 3 |
| safekeys/secret-transport | 3 |
| safekeys/token-revocation | 3 |
| safekeys/capability-token | 4 |
| safekeys/encrypted-folder | 3 |
| safekeys/envelope-encryption | 4 |
| safekeys/dev-key-custody | 4 |
| safekeys/exec-wrapper | 3 |
| safekeys/output-control | 9 |
| safekeys/secret-injection | 3 |
| safekeys/sidecar-resolution | 5 |
Additional Testing Policies
- Security Testing: Prompt-injection and stolen-token abuse cases asserted against the sidecar.
- Automated Testing: Per-service unit and integration tests, plus a two-agent demo test asserting neither transcript contains plaintext.
- CI Integration: usm generate --check plus per-service lint, typecheck, and test on the affected modules.