testutil

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const VaultRootToken = "root"

VaultRootToken is the dev-mode root token used by the throwaway Vault container created by CreateVault.

Variables

View Source
var (
	Alice        = testutil.Alice
	Bob          = testutil.Bob
	Carol        = testutil.Carol
	Mallory      = testutil.Mallory
	RandomBytes  = testutil.RandomBytes
	RandomDID    = testutil.RandomDID
	RandomSigner = testutil.RandomSigner
	RandomIssuer = testutil.RandomIssuer
)

Functions

func CreatePostgres

func CreatePostgres(t *testing.T) *pgxpool.Pool

CreatePostgres starts a throwaway Postgres container, runs the hilt migrations against it, and returns a connection pool. The container is cleaned up when the test finishes.

func CreateVault

func CreateVault(t *testing.T) (address, token string)

CreateVault starts a throwaway HashiCorp Vault dev-mode container (which auto-mounts a KV v2 engine at "secret") and returns its address and root token. The container is cleaned up when the test finishes.

func IsDockerAvailable

func IsDockerAvailable(t testing.TB) bool

IsDockerAvailable returns true if the docker daemon is available, useful for skipping tests when docker isn't running.

func IsRunningInCI

func IsRunningInCI(t testing.TB) bool

IsRunningInCI returns true if the process is running in a CI environment.

func Must

func Must[T any](val T, err error) func(*testing.T) T

func RandomCID

func RandomCID(t *testing.T) cid.Cid

Types

This section is empty.

Jump to

Keyboard shortcuts

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