Documentation
¶
Overview ¶
Package testsupport provides shared helpers for integration tests that need a real Postgres database.
Index ¶
Constants ¶
View Source
const EnvURL = "LEGANT_TEST_DATABASE_URL"
EnvURL points at a Postgres the tests may create throwaway databases on.
Variables ¶
This section is empty.
Functions ¶
func DB ¶
DB provisions a fresh, migrated, throwaway database for the calling test and returns a pool to it. Each call gets its own database (dropped at cleanup), so integration tests are fully isolated and safe to run in parallel across packages — even when they reset shared tables like signing_keys. The test is skipped when LEGANT_TEST_DATABASE_URL is unset (unless LEGANT_REQUIRE_DB is set, e.g. in CI, where an unset URL is a hard failure).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.