All tests require the full stack (DB, S3, K8s) running via Docker Compose. Tests use real services - no mocks.
# Start services and run all tests using the test override
docker compose -f compose.yaml -f compose.test.yaml up -d db s3
docker compose -f compose.yaml -f compose.test.yaml run --rm api
# Run specific test package
docker compose -f compose.yaml -f compose.test.yaml run --rm api go test -v ./app/meta/...
# Run E2E tests (requires build tag)
docker compose -f compose.yaml -f compose.test.yaml run --rm api go test -v -tags=e2e .- Integration Tests (
app/*/*_test.go) - Test components with real database, S3, and Kubernetes - E2E Tests (
main_test.go) - Test full system end-to-end scenarios
Each test package provides helpers:
testDB(t)- Creates database connection with cleanup (inapp/api,app/meta,app/db)testWorkflowClient(t)- Creates real Argo Workflows client (inapp/api)testutil.TestDBURL()- Returns database URL fromSCALEODM_DATABASE_URL
Example:
func TestFeature(t *testing.T) {
db, cleanup := testDB(t)
defer cleanup()
store := meta.NewStore(db)
// ... test code
}- Database: Uses
SCALEODM_DATABASE_URL(same as production). Tests automatically clean up after themselves. - S3: Uses
AWS_S3_ENDPOINT(RustFS S3 in compose stack). - Kubernetes: Requires real cluster (Talos) with Argo Workflows installed.
# Check services
docker compose -f compose.yaml -f compose.test.yaml ps
# Check database connection
psql postgres://odm:odm@localhost:31101/scaleodm?sslmode=disable
# Check Kubernetes
kubectl get pods -n argo