Testing Guide
Running Tests
Section titled “Running Tests”Unit Tests
Section titled “Unit Tests”Run all unit tests (default):
go test ./...Integration Tests
Section titled “Integration Tests”Integration tests require external services (NATS, Redis) and use the -tags=integration build tag.
Prerequisites:
- NATS running (Docker:
docker compose up -d nats) - Redis running (Docker:
docker compose up -d redis)
Run all integration tests:
go test -tags=integration ./...Run specific package:
# ECDSA tests (requires environment variables)op run --env-file=internal/support/ecdsa/test.env -- go test -tags=integration ./internal/support/ecdsa
# Consumer API testsgo test -tags=integration ./services/consumer/api
# OMS (Object Management System) testsgo test ./internal/domain/omsTest Status
Section titled “Test Status”✅ Passing Tests
Section titled “✅ Passing Tests”- Unit Tests:
internal/domain/oms,internal/domain/*,internal/support/geoip,internal/support/jwt,internal/support/locks,internal/infra/store,internal/domain/txnlib - Integration Tests:
services/consumer/api,internal/support/ecdsa(with env vars)
🔧 Requires Environment Setup
Section titled “🔧 Requires Environment Setup”internal/support/ecdsa- requiresST8_PRIVATE_KEYandST8_PUBLIC_KEYenv varsservices/consumer/api- requires NATS running
Tests work out-of-the-box in CI environments:
# Start required services (for integration tests)docker compose up -d nats redis
# Run all testsgo test ./...
# Run integration tests onlygo test -tags=integration ./...