Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMySQLTestContainer ¶ added in v0.2.3
func NewMySQLTestContainer() *mySQLTestContainer
NewMySQLTestContainer returns an implementation of the DatastoreTestContainer interface for MySQL.
func NewPostgresTestContainer ¶ added in v0.2.0
func NewPostgresTestContainer() *postgresTestContainer
NewPostgresTestContainer returns an implementation of the DatastoreTestContainer interface for Postgres.
Types ¶
type DatastoreTestContainer ¶ added in v0.2.0
type DatastoreTestContainer interface { // GetConnectionURI returns a connection string to the datastore instance running inside // the container. GetConnectionURI(includeCredentials bool) string // GetDatabaseSchemaVersion returns the last migration applied (e.g. 3) when the container was created GetDatabaseSchemaVersion() int64 GetUsername() string GetPassword() string }
DatastoreTestContainer represents a runnable container for testing specific datastore engines.
func RunDatastoreTestContainer ¶ added in v0.2.0
func RunDatastoreTestContainer(t testing.TB, engine string) DatastoreTestContainer
RunDatastoreTestContainer constructs and runs a specifc DatastoreTestContainer for the provided datastore engine. If applicable, it also runs all existing database migrations. The resources used by the test engine will be cleaned up after the test has finished.
Click to show internal directories.
Click to hide internal directories.