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, PostgreSQL, Redis) and use the -tags=integration build tag.
Prerequisites:
- PostgreSQL running (Docker:
docker compose up -d postgres) - 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/ecdsa/test.env -- go test -tags=integration ./internal/ecdsa
# Consumer API testsgo test -tags=integration ./services/consumer/api
# OMS (Object Management System) testsgo test ./internal/omsTest Status
Section titled “Test Status”✅ Passing Tests
Section titled “✅ Passing Tests”- Unit Tests:
internal/oms,internal/domain/*,internal/geoip,internal/jwt,internal/locks,internal/store,internal/txnlib - Integration Tests:
services/consumer/api,internal/ecdsa(with env vars)
🔧 Requires Environment Setup
Section titled “🔧 Requires Environment Setup”internal/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 postgres nats redis
# Run all testsgo test ./...
# Run integration tests onlygo test -tags=integration ./...