pgtest

package
v1.21.1-rc-multipart Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCockroach = "cockroach://root@localhost:26257/master?sslmode=disable"

DefaultCockroach is expected to work when a local cockroachDB instance is running.

View Source
const DefaultPostgres = "postgres://storj:storj-pass@test-postgres/teststorj?sslmode=disable"

DefaultPostgres is expected to work under the storj-test docker-compose instance.

Variables

This section is empty.

Functions

func PickCockroach

func PickCockroach(t TB) string

PickCockroach picks one cockroach database from flag.

func PickCockroachAlt added in v1.14.1

func PickCockroachAlt(t TB) string

PickCockroachAlt picks an alternate cockroach database from flag.

This is used for high-load tests to ensure that other tests do not timeout.

func PickPostgres

func PickPostgres(t TB) string

PickPostgres picks one postgres database from flag.

func Run

func Run(t *testing.T, test func(ctx *testcontext.Context, t *testing.T, connstr string))

Run runs tests with all postgres compatible databases.

Types

type Database

type Database struct {
	Name string
	// Pick picks a connection string for the database and skips when it's missing.
	Pick func(t TB) string
}

Database defines a postgres compatible database.

func Databases

func Databases() []Database

Databases returns list of postgres compatible databases.

type TB

type TB interface {
	Skip(...interface{})
}

TB defines minimal interface required for Pick.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL