Skip to main content
Version: v0.2.6

Testing

pkg/base/test configures the SDK test environment and provides Testcontainers helpers.

import (
"os"
"testing"

colibriTest "github.com/colibriproject-dev/colibri-sdk-go/pkg/base/test"
)

func TestMain(m *testing.M) {
colibriTest.InitializeBaseTest()
os.Exit(m.Run())
}

Available integrations include Redis, PostgreSQL, LocalStack, GCP emulators, RabbitMQ, and WireMock. They require a Docker runtime.

To assert on the metrics your code records, use monitoringtest.Install(t). See Testing metrics.

Prefer local substitutes for unit tests and containers only when provider behavior is part of the test.