Documentation
¶
Overview ¶
Package testdb gives integration-test binaries fresh Postgres databases. Whole-database sweeps and cleanup may share a binary, but cannot reach another package's fixtures or a previous invocation's state.
Index ¶
Constants ¶
const Environment = "AGENTRY_TEST_DATABASE_URL"
Environment names the server database before Main and the private database inside that test binary. Without it integration tests retain their skips.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main runs a package's tests with an isolated database and removes it after they finish. A TestMain calls os.Exit(testdb.Main(m)); migrations remain the package's responsibility, so migration tests can still start from nothing.
func ParentDatabase ¶
func ParentDatabase() string
ParentDatabase is the configured database's name, for guards that prove their package actually ran through Main rather than on the shared parent.
Types ¶
This section is empty.