Testing
Rack Gateway uses unit, integration, and end-to-end tests across Go and web codebases.
Use task commands to keep codegen, containers, and test dependencies in sync.
Test Overview
Section titled “Test Overview”| Test Type | Location | Command |
|---|---|---|
| Go Unit + Integration | internal/** | task go:test |
| Web Unit | web/src/**/*.test.ts* | task web:test |
| Web E2E | web/e2e/ | task web:e2e |
| CLI E2E | scripts/cli-e2e.sh | task go:e2e |
Running Tests
Section titled “Running Tests”Full Test Suite
Section titled “Full Test Suite”task ciGo Tests
Section titled “Go Tests”task go:testWeb Tests
Section titled “Web Tests”task web:testE2E Tests
Section titled “E2E Tests”# Web E2Etask web:e2e
# CLI E2Etask go:e2eFocused E2E Runs
Section titled “Focused E2E Runs”Use --grep to run a single Playwright test:
task web:e2e -- --grep "manage MFA"CLI E2E filters are exposed as task variants:
task go:e2e:admintask go:e2e:api-tokentask go:e2e:deployertask go:e2e:viewerTest Layout
Section titled “Test Layout”internal/├── gateway/ # Unit + integration tests alongside code└── integration/ # Additional integration scenarios
web/├── src/ # Vitest unit tests└── e2e/ # Playwright testsWriting Tests
Section titled “Writing Tests”- Keep unit tests close to the code under test (
*_test.go,*.test.tsx). - Use E2E tests for cross-service workflows (OAuth, RBAC, deploy approvals).
- Prefer
taskcommands so the local environment matches CI behavior.