Testing
API (Go)
Section titled “API (Go)”Run unit tests for all internal packages:
go test ./internal/... -v -timeout 5m -coverprofile=cover.outTests use pgxmock for database mocking and testify for assertions. Each package follows table-driven test patterns.
Integration tests
Section titled “Integration tests”Integration tests require a real PostgreSQL and Redis instance (provided by Docker in local dev). Run them with the integration build tag:
go test -tags=integration ./internal/... -v -timeout 5mCLI (Go)
Section titled “CLI (Go)”go test ./... -v -timeout 5m -count=1Integration tests use the same build tag:
go test -tags=integration ./... -v -timeout 5mDashboard
Section titled “Dashboard”Unit tests
Section titled “Unit tests”The dashboard uses Vitest with jsdom for unit and component tests:
# Watch modepnpm test
# Coverage report (lcov)pnpm test:coverageEnd-to-end tests
Section titled “End-to-end tests”E2E tests use Playwright with Chromium. They require the API server to be running and a preview build of the dashboard:
pnpm test:e2eCI pipeline
Section titled “CI pipeline”Tests run in this order on every push:
- Lint (golangci-lint, ESLint)
- Unit tests (Go + Vitest)
- Build (Docker image + dashboard)
- Integration tests (Go with Postgres/Redis service containers)
- E2E tests (Playwright)
All CI jobs run on self-hosted runners with PostgreSQL and Redis available as service containers.
Scheduled tests
Section titled “Scheduled tests”- Registry compatibility — runs on a schedule to verify rule pack compatibility with the current engine
- Nightly E2E — a separate workflow runs the full Playwright suite against a staging-like environment