testutils

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertLogFixtures added in v0.0.11

func InsertLogFixtures(ctx context.Context, pool *pgxpool.Pool, logs []logstore.Row) ([]int64, error)

InsertLogFixtures seeds retained rows, including records without event keys. Returned IDs correspond to the input rows.

func NewPostgresPool

func NewPostgresPool(t *testing.T, ctx context.Context) *pgxpool.Pool

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite

	PostgresPool *pgxpool.Pool

	// NATS
	NatsContainer *nats.NATSContainer
	NatsAddr      string
	NatsConn      *natsconn.NatsConnection

	// Services
	NatsCredsService *serverauth.NatsCredentialService
	ProjectsService  *projects.PostgresProjectsService

	// WebSocket
	LiveLogs *live.Logs
	// contains filtered or unexported fields
}

BaseSuite provides PostgreSQL and NATS for integration suites.

func (*BaseSuite) SetupSuite

func (s *BaseSuite) SetupSuite()

SetupSuite starts PostgreSQL and NATS containers.

func (*BaseSuite) TearDownSuite

func (s *BaseSuite) TearDownSuite()

TearDownSuite cleans up all containers

func (*BaseSuite) WithConfig

func (s *BaseSuite) WithConfig(config BaseSuiteConfig)

WithConfig sets custom configuration for the suite

type BaseSuiteConfig

type BaseSuiteConfig struct {
	ConfigPath      string
	NatsAccountSeed string
	NatsJwt         string
	NatsSeed        string
}

BaseSuiteConfig holds configuration for the base test suite

func DefaultBaseSuiteConfig

func DefaultBaseSuiteConfig() BaseSuiteConfig

DefaultBaseSuiteConfig returns sensible defaults

Jump to

Keyboard shortcuts

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