testutils

package
v0.0.0-...-ec9b500 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGlobalPostgresPool

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

func RandomEventType

func RandomEventType() sharedDomain.EventType

RandomEventType returns a unique event type for testing.

func VerifyTestMain

func VerifyTestMain(m *testing.M) int

VerifyTestMain standardizes goroutine leak checks. We avoid closing the global pool here because other parallel test processes might still be using the shared container.

Types

type PostgreSQLContainer

type PostgreSQLContainer struct {
	// contains filtered or unexported fields
}

func (*PostgreSQLContainer) CreateTestDatabase

func (p *PostgreSQLContainer) CreateTestDatabase(ctx context.Context, t *testing.T) *pgxpool.Pool

type RabbitMQContainer

type RabbitMQContainer struct {
	// contains filtered or unexported fields
}

func GetGlobalRabbitMQ

func GetGlobalRabbitMQ(t *testing.T) *RabbitMQContainer

func (*RabbitMQContainer) Connect

func (r *RabbitMQContainer) Connect(ctx context.Context, t *testing.T) *rabbitmq.Conn

func (*RabbitMQContainer) StartTestConsumer

func (r *RabbitMQContainer) StartTestConsumer(t *testing.T, conn *rabbitmq.Conn, exchangeName, exchangeKind, bindingKey string) (<-chan rabbitmq.Delivery, *rabbitmq.Consumer)

StartTestConsumer creates a consumer bound to the specified exchange with the given key.

type RedisContainer

type RedisContainer struct {
	// contains filtered or unexported fields
}

func GetGlobalRedis

func GetGlobalRedis(t *testing.T) *RedisContainer

func (*RedisContainer) Connect

func (r *RedisContainer) Connect(ctx context.Context, t *testing.T) *redis.Client

Jump to

Keyboard shortcuts

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