pgtest

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 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 a random cockroach database from flag.

func PickPostgres

func PickPostgres(t TB) string

PickPostgres picks a random 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