Browse docs
--- title: "Testing Strategy" description: "Aurora's 3-layer testing strategy: unit tests, integration tests, and contract replay tests." icon: "test-tube" ---
Testing Strategy
Aurora uses a 3-layer testing strategy:
Layer 1: Unit Tests
Package-level tests that verify individual components in isolation.
bash
go test ./internal/... # All unit tests
go test ./internal/server # Server package testsLayer 2: Integration Tests
Tests that verify interactions between components with real dependencies (database, cache).
bash
make test-race # With race detection
make test-e2e # End-to-end testsLayer 3: Contract Replay Tests
Tests that verify behavior against recorded provider responses, ensuring compatibility across versions.
Test Organization
- Tests live alongside the code they test (
_test.gofiles in the same package) - Integration tests use build tags where needed
- E2E tests use in-process mock servers (no Docker dependency)
Coverage
bash
make test-race # Includes coverage outputBenchmark Tests
Gateway stack benchmarks are in internal/server/gateway_stack_bench_test.go:
bash
go test ./internal/server -run "^$" -bench BenchmarkGatewayStack -benchtime 10s -benchmemSee Benchmark Setup for side-by-side comparison benchmarks.