Documentation
¶
Overview ¶
Package testpostgres provisions a Postgres backend for store tests.
It is test-only support code and intentionally the ONLY place in the store tree that imports testcontainers, keeping that heavy, Docker-bound dependency out of the shipped server binary's dependency graph.
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrUnavailable means no Postgres backend could be provisioned: neither STACKIT_TEST_DATABASE_URL is set nor could a throwaway container start. Callers should t.Skip on this so the suite stays green without Docker.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
type Harness struct {
URL string
// contains filtered or unexported fields
}
Harness owns the connection string for store tests and serializes access so parallel tests don't observe each other's rows.
func Start ¶
Start provisions a backend. Precedence:
- STACKIT_TEST_DATABASE_URL (e.g. a CI service container) — used directly.
- A throwaway testcontainer (local dev with a running Docker daemon).
It returns ErrUnavailable when neither is possible.