Skip to content

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 TypeLocationCommand
Go Unit + Integrationinternal/**task go:test
Web Unitweb/src/**/*.test.ts*task web:test
Web E2Eweb/e2e/task web:e2e
CLI E2Escripts/cli-e2e.shtask go:e2e
Terminal window
task ci
Terminal window
task go:test
Terminal window
task web:test
Terminal window
# Web E2E
task web:e2e
# CLI E2E
task go:e2e

Use --grep to run a single Playwright test:

Terminal window
task web:e2e -- --grep "manage MFA"

CLI E2E filters are exposed as task variants:

Terminal window
task go:e2e:admin
task go:e2e:api-token
task go:e2e:deployer
task go:e2e:viewer
internal/
├── gateway/ # Unit + integration tests alongside code
└── integration/ # Additional integration scenarios
web/
├── src/ # Vitest unit tests
└── e2e/ # Playwright 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 task commands so the local environment matches CI behavior.