testdb

package
v0.7.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 10 Imported by: 0

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

View Source
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

func Main(m *testing.M) int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL