Documentation ¶
Overview ¶
package dockertestenv provides test environment where service dependencies are docker containers
Index ¶
- Constants
- func EnsureDBEnv(ctx context.Context) error
- func NewEphemeralMySQLDB(ctx context.Context, t testing.TB) (*pachsql.DB, string)
- func NewEphemeralPostgresDB(ctx context.Context, t testing.TB) (*pachsql.DB, string)
- func NewMySQLURL(ctx context.Context, t testing.TB) pachsql.URL
- func NewTestBucket(ctx context.Context, t testing.TB) (*blob.Bucket, string)
- func NewTestDB(t testing.TB) *pachsql.DB
- func NewTestDirectDB(t testing.TB) *pachsql.DB
- func PGBouncerHost() string
- type DBConfig
- type PostgresConfig
Constants ¶
View Source
const ( PGBouncerPort = 30229 DefaultPostgresPassword = "correcthorsebatterystable" DefaultPostgresUser = "pachyderm" DefaultPostgresDatabase = "pachyderm" )
View Source
const (
MySQLPassword = "root"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureDBEnv ¶ added in v2.9.0
TODO: use the docker client, instead of the bash script TODO: use the bitnami pg_bouncer image TODO: look into https://github.com/ory/dockertest
func NewEphemeralMySQLDB ¶
func NewEphemeralPostgresDB ¶
NewEphemeralPostgresDB creates a randomly-named new database, returning a connection to the new DB and the name itself.
func NewMySQLURL ¶
NewMySQLURL returns a pachsql.URL to an ephemeral database.
func PGBouncerHost ¶
func PGBouncerHost() string
Types ¶
type DBConfig ¶ added in v2.8.0
type DBConfig struct { Direct PostgresConfig PGBouncer PostgresConfig Identity PostgresConfig }
func NewTestDBConfig ¶
NewTestDBConfig returns a DBConfig for a test environment The environment will be torn down at the end of the test.
func (DBConfig) PachConfigOption ¶ added in v2.8.0
func (dbc DBConfig) PachConfigOption(c *pachconfig.Configuration)
Click to show internal directories.
Click to hide internal directories.