Documentation ¶
Overview ¶
Package integration is a helper for running integration tests.
Index ¶
Constants ¶
const ( DefaultDSN = `host=localhost port=5434 user=claircore dbname=claircore sslmode=disable` // connection string for our local development. see docker-compose.yaml at root EnvPGConnString = "POSTGRES_CONNECTION_STRING" )
DefaultDSN is a dsn for database server usually set up by the project's Makefile.
Variables ¶
This section is empty.
Functions ¶
func Skip ¶
Skip will skip the current test or benchmark if this package was built without the "integration" build tag.
This should be used as an annotation at the top of the function, like (*testing.T).Parallel().
func TestThatTouchesNetwork(t *testing.T) { t.Parallel() integration.Skip(t) // ... }
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a handle for connecting to an cleaning up a created database.
func NewDB ¶
NewDB generates a unique database instance for use in concurrent integration tests.
An environment variable maybe use to provide the root connection string used to generate a test specific database.
If no environment variable is specified the root connection string defaults to our local development db connection string DefaultDSN.