Testing Strategy
Layers
- Unit — domain invariants, pure logic (Go + web schemas).
- Authorization — owner/editor/viewer/stranger, delegate limits, cross-object isolation (real relation engine).
- API/HTTP — handler behavior, RFC 7807, health, fail-closed auth.
- Integration — pgx repository + unit-of-work against real Postgres/PostGIS
(
-tags=integration); 72 test files carry the tag today. - Row-level security — the same integration suite run as
buddora_runtime(task api:test:rls). This layer is not optional garnish: the plain integration run connects as the schema owner, which bypasses every RLS policy, so it cannot fail on an isolation mistake. - Live — OIDC and OpenFGA against real running instances, behind
-tags=live_keycloak/-tags=live_openfga. On demand, not automated. - Web — Vitest + Testing Library per portal and per shared package.
- Browser E2E — Playwright specs exist under
apps/web/e2e(critical journeys, CSP nonce boot, visual regression). - Load —
apps/api/cmd/loadtest, a small in-repo Go tool. See Load, capacity and rate-limit testing for real measured numbers and an explicit account of what they do and do not prove.
Where each layer actually runs
This matters more than the list above, because GitHub Actions does not execute for this project:
| Layer | Runs in |
|---|---|
| Go unit tests | apps/api/Dockerfile — on every Coolify build, and scripts/verify.sh |
| Go race tests, integration, RLS | scripts/verify.sh only (integration needs --with-db) |
| Portal + package component tests | scripts/verify.sh only — not in the portal images, deliberately: they are timing-sensitive and failed under contention on the deployment host while passing in an identical container locally |
| Playwright E2E, visual regression | Nothing runs them automatically. No Dockerfile and no scripts/verify.sh line invokes test:e2e |
| Live OIDC/OpenFGA | run by hand |
So the only tests any deployment runs are the Go unit tests. Everything else depends on
somebody running scripts/verify.sh before pushing.
Coverage
The package-level percentages this page carried (57–100%, with per-package figures) came from
a v1.0-RC measurement and have not been re-measured since; treat them as unverified rather
than current. Run go test -cover ./... for a number you can trust.
One coverage figure that is current and worth knowing: the integration suite exercises
33 of the 73 tables that carry row-level-security policies, so 40 carry a policy nothing
has yet read through under the runtime role (ROADMAP.md, EPIC-52).
Policy
Every bug fix ships with a regression test.
Open: getting the Playwright suites into a gate that actually runs, PostGIS/NATS coverage beyond the current integration set, and a security regression suite.