Documentation
¶
Overview ¶
Package testutil provides shared test helpers and mock implementations for gas-auth integration and unit tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNopLogger ¶
NewNopLogger creates a gas.Logger that discards all output.
func SetupSQLite ¶
SetupSQLite creates an in-memory SQLite database wired into real gas-database and gas-migrate services.
MaxOpenConns is pinned to 1 because each connection to a ":memory:" database gets its own private schema; a larger pool would see inconsistent state.
Types ¶
type PostgresContainer ¶
type PostgresContainer struct {
Container *postgres.PostgresContainer
ConnStr string
DB *sql.DB
// contains filtered or unexported fields
}
PostgresContainer holds a running PostgreSQL testcontainer plus real gas-database and gas-migrate services bound to it.
func SetupPostgres ¶
func SetupPostgres(t *testing.T) *PostgresContainer
SetupPostgres starts a PostgreSQL container and returns a real database and migrate service backed by it.
func (*PostgresContainer) MigrationManager ¶
func (pc *PostgresContainer) MigrationManager() *migrate.Service
MigrationManager returns the real migration service for this container.
func (*PostgresContainer) Provider ¶
func (pc *PostgresContainer) Provider() *database.Service
Provider returns the real database service for this container.