Documentation
¶
Overview ¶
Package testpostgres runs a real Postgres for tests from embedded-postgres' downloaded binaries, so the Postgres-backed tests need no docker daemon.
Index ¶
Constants ¶
const RequireEnv = "STEPS_REQUIRE_POSTGRES"
RequireEnv names the variable that, set to 1, turns unobtainable binaries from a skip into a failure, for a run that must not pass by not testing Postgres.
Variables ¶
ErrUnavailable means the server's binaries could not be had (the first run on a machine downloads them), which a caller treats as a skip. Anything else Start returns is a failure.
var Fast = map[string]string{
"max_connections": "500",
"fsync": "off",
"synchronous_commit": "off",
"full_page_writes": "off",
}
Fast trades durability for speed, for tests whose database dies with the run. A measurement leaves it out: Postgres' own defaults are what an operator gets.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Host is "127.0.0.1:port".
Host string
Password string
// contains filtered or unexported fields
}
Server is a running Postgres reachable on loopback only, with a password nothing else knows.
func Start ¶
Start sweeps first because a run killed outright never reached its own Stop. With STEPS_REQUIRE_POSTGRES=1 unobtainable binaries are a failure rather than an ErrUnavailable skip.