Documentation ¶
Index ¶
Constants ¶
const IntegrationRunnerEnvVar = "RUN_INTEGRATION_TESTS"
Variables ¶
This section is empty.
Functions ¶
func IsSkipIntegrationTest ¶
IsSkipIntegrationTest returns true if the integration test should be skipped.
Types ¶
type PostgresDockerInstance ¶
type PostgresDockerInstance struct {
// contains filtered or unexported fields
}
PostgresDockerInstance represents a running Postgres test container with settings.
func MustRunPostgresDockerContainer ¶
func MustRunPostgresDockerContainer() (PostgresDockerInstance, func())
MustRunPostgresDockerContainer creates a new Postgres test container and initializes the application repositories. It returns a cleanup function that must be called to terminate the container. It panics if the container cannot be started.
func RunPostgresDockerContainer ¶
func RunPostgresDockerContainer() (PostgresDockerInstance, func(), error)
RunPostgresDockerContainer creates a new Postgres test container and initializes the application repositories. It returns a cleanup function that must be called to terminate the container.
func (*PostgresDockerInstance) ConnURL ¶
func (p *PostgresDockerInstance) ConnURL() string
ConnURL returns a fully constructed connection URL with all resolved values, using this template: "postgres://%s:%s@%s:%s/%s?sslmode=disable".
func (*PostgresDockerInstance) MustTruncateData ¶
func (p *PostgresDockerInstance) MustTruncateData()
MustTruncateData truncates all data in the Postgres DB. Can be used after the tests to clean up all the user's data.
It panics if the truncation fails.
func (*PostgresDockerInstance) PgxPool ¶
func (p *PostgresDockerInstance) PgxPool() *pgxpool.Pool
PgxPool returns a PGX connection pool that can be used to execute queries against the Postgres DB.
func (*PostgresDockerInstance) TruncateDataInTest ¶
func (p *PostgresDockerInstance) TruncateDataInTest(t *testing.T)