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 ¶
ObserveExecutionLeaseRelease captures the current owner before shutdown. Local pgx cleanup does not acknowledge the server's release of its advisory lock.
func Open ¶
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 ¶
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.