testhelpers

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PostgresImage is the default PostgreSQL test container image.
	PostgresImage = "postgres:17-alpine"
	// MySQLImage is the default MySQL test container image.
	MySQLImage = "mysql:lts"
	// RedisImage is the default Redis test container image.
	RedisImage = "redis:8-alpine"
	// MinIOImage is the default MinIO test container image.
	MinIOImage = "minio/minio:latest"
)

Test container image constants.

View Source
const (
	// TestDatabaseName is the default test database name.
	TestDatabaseName = "testdb"
	// TestUsername is the default test database username.
	TestUsername = "testuser"
	// TestPassword is the default test database password.
	TestPassword = "testpass"
)

Test database configuration constants.

View Source
const (
	// TestMinIOAccessKey is the default MinIO access key.
	TestMinIOAccessKey = "testadmin"
	// TestMinIOSecretKey is the default MinIO secret key.
	TestMinIOSecretKey = "testadmin"
	// TestMinioBucket is the default test bucket name.
	TestMinioBucket = "testbucket"
)

Test MinIO configuration constants.

View Source
const (
	// DefaultContainerTimeout is the default timeout for container startup.
	DefaultContainerTimeout = 30 * time.Second
)

Test timeout constants.

Variables

This section is empty.

Functions

func IsTestEnv

func IsTestEnv() bool

IsTestEnv checks if the code is running in test mode.

Types

type MinIOContainer

type MinIOContainer struct {
	Config *config.MinIOConfig
	// contains filtered or unexported fields
}

func NewMinIOContainer

func NewMinIOContainer(ctx context.Context, suite *suite.Suite) *MinIOContainer

func (*MinIOContainer) Terminate

func (c *MinIOContainer) Terminate(ctx context.Context, suite *suite.Suite)

type MySQLContainer

type MySQLContainer struct {
	DsConfig *config.DatasourceConfig
	// contains filtered or unexported fields
}

func NewMySQLContainer

func NewMySQLContainer(ctx context.Context, suite *suite.Suite) *MySQLContainer

func (*MySQLContainer) Terminate

func (c *MySQLContainer) Terminate(ctx context.Context, suite *suite.Suite)

type PostgresContainer

type PostgresContainer struct {
	DsConfig *config.DatasourceConfig
	// contains filtered or unexported fields
}

func NewPostgresContainer

func NewPostgresContainer(ctx context.Context, suite *suite.Suite) *PostgresContainer

func (*PostgresContainer) Terminate

func (c *PostgresContainer) Terminate(ctx context.Context, suite *suite.Suite)

type RedisContainer

type RedisContainer struct {
	RdsConfig *config.RedisConfig
	// contains filtered or unexported fields
}

func NewRedisContainer

func NewRedisContainer(ctx context.Context, suite *suite.Suite) *RedisContainer

func (*RedisContainer) Terminate

func (c *RedisContainer) Terminate(ctx context.Context, suite *suite.Suite)

Jump to

Keyboard shortcuts

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