Documentation
¶
Overview ¶
Package testsupport provides shared test-only infrastructure helpers (e.g. spinning up throwaway database containers) for use across the module's test files. It is a regular (non-_test.go) package so its helpers can be imported by tests in other packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDockerAvailable ¶
func IsDockerAvailable() bool
IsDockerAvailable reports whether a working Docker daemon is reachable. Portable across platforms (Linux, macOS, Windows).
func StartMongoContainer ¶
StartMongoContainer spins up a throwaway MongoDB via testcontainers and returns its connection URI, a connected *mongo.Client, and a cleanup function. Skips the calling test if Docker is not available.
func TestLogger ¶
TestLogger builds a *logger.Log suitable for use in unit tests.
Deliberately does not also provide a tracer helper here: pkg/trace depends on pkg/model, which in turn depends on packages (e.g. pkg/mdoc) that import pkg/cache. Since pkg/cache's own tests import testsupport, pulling pkg/trace/pkg/model into this package would create an import cycle. The shared tracer test helper instead lives in the separate leaf package pkg/testsupport/tracertest, which stays cycle-free.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cachetest provides a generic constructor helper for the near-identical cache.New(ctx, cfg, dbService, tracer, log) tests that exist once per service package (apigw, verifier, registry).
|
Package cachetest provides a generic constructor helper for the near-identical cache.New(ctx, cfg, dbService, tracer, log) tests that exist once per service package (apigw, verifier, registry). |
|
Package sqltest provides shared Postgres/MariaDB testcontainer helpers, pre-migrated and ready to use, for repository-level SQL store tests, plus NewServiceForTest (service.go) - the shared "build cfg, call a db package's New(), register Close on cleanup" harness every db.Service's SQL contract test uses.
|
Package sqltest provides shared Postgres/MariaDB testcontainer helpers, pre-migrated and ready to use, for repository-level SQL store tests, plus NewServiceForTest (service.go) - the shared "build cfg, call a db package's New(), register Close on cleanup" harness every db.Service's SQL contract test uses. |
|
Package tracertest provides a shared *trace.Tracer constructor for use in unit tests.
|
Package tracertest provides a shared *trace.Tracer constructor for use in unit tests. |