pgtest

package
v1.106.0-rc Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: AGPL-3.0 Imports: 6 Imported by: 1

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.

View Source
const DefaultSpanner = "spanner://projects/storj-test/instances/test-instance/databases/metainfo"

DefaultSpanner is expected to work when a local spanner emulator is running.

Variables

This section is empty.

Functions

func PickCockroach

func PickCockroach(t TB) string

PickCockroach picks one cockroach database from flag.

func PickCockroachAlt

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 PickSpanner

func PickSpanner(t TB) string

PickSpanner picks one spanner 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
	Flag *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