testenv

package
v0.0.0-...-6b1555b Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAuthContext

func InitAuthContext(t *testing.T, ctx context.Context, conn *pgxpool.Pool, sessionManager *sessions.Manager) context.Context

func NewLogger

func NewLogger(*testing.T) *slog.Logger

func NewMeterProvider

func NewMeterProvider(t *testing.T) metric.MeterProvider

func NewTemporalDevServer

func NewTemporalDevServer(t *testing.T, ctx context.Context) (*testsuite.DevServer, error)

func NewTestcontainersLogger

func NewTestcontainersLogger() log.Logger

func NewTracerProvider

func NewTracerProvider(t *testing.T) trace.TracerProvider

func ReadFixture

func ReadFixture(t *testing.T, path string) []byte

Types

type Environment

type Environment struct {
	CloneTestDatabase PostgresDBCloneFunc
	NewRedisClient    RedisClientFunc
	NewTemporalClient func(t *testing.T) (client client.Client, server *testsuite.DevServer)
}

func Launch

func Launch(ctx context.Context) (*Environment, func() error, error)

type PostgresDBCloneFunc

type PostgresDBCloneFunc func(t *testing.T, name string) (*pgxpool.Pool, error)

func NewTestPostgres

NewTestPostgres creates a new Postgres container with a template database built from a SQL init script. A reference to the container is returned as well as a function to create test databases from the template. All "clone" databases are automatically dropped when the test ends using t.Cleanup() hooks.

type RedisClientFunc

type RedisClientFunc func(t *testing.T, db int) (*redis.Client, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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