pgtest

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pgtest opens PostgreSQL databases for Core tests. Only test files import it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialKey added in v0.0.10

func CredentialKey(t testing.TB) *credentialcrypto.Cipher

CredentialKey returns a cipher under a fixed test credential key, for tests that need a key but not a particular one.

func ObserveExecutionLeaseRelease

func ObserveExecutionLeaseRelease(t *testing.T, pool *pgxpool.Pool) func()

ObserveExecutionLeaseRelease captures the current owner before shutdown. Local pgx cleanup does not acknowledge the server's release of its advisory lock.

func Open

func Open(t testing.TB) *pgxpool.Pool

Open returns a pool on the dedicated test database named by OAC_TEST_DATABASE_URL, with Core's migrations applied, and skips the test when the variable is unset. Tests on this shared database isolate their data with fresh tenant and project IDs.

func OpenIsolated

func OpenIsolated(t testing.TB, configure func(*pgxpool.Config)) *pgxpool.Pool

OpenIsolated creates a fresh migrated database beside the one Open uses and drops it when the test ends. Tests use it for state that belongs to a whole database, such as the execution lease or the sandbox deployment identity. configure, when not nil, adjusts the returned pool's configuration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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