integration

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package integration provides resources for doing integration testing.

Index

Constants

View Source
const (
	// DefaultContainerTTL is the default ttl for docker containers
	DefaultContainerTTL = time.Minute

	// DefaultMaxConnectTime is the default amount of time to allow connecting
	DefaultMaxConnectTime = 60 * time.Second

	// DefaultTag is the default tag for the postgres docker image
	DefaultTag = "13"

	// DefaultDockerEndpoint is the default docker endpoint for connections
	DefaultDockerEndpoint = ""
)

Variables

This section is empty.

Functions

func ExpectExit

func ExpectExit(t *testing.T, expect int) func(code int)

ExpectExit is a test function for asserting exit codes when exit is called

func RunPostgres

func RunPostgres(integration *Postgres)

RunPostgres runs a new postgres integration

Types

type Postgres

type Postgres struct {
	Repository *datastore.Repository
	Migration  struct {
		FS        fs.FS
		Directory string
	}
	ImageTag       string
	ContainerTTL   time.Duration
	MaxConnectTime time.Duration
	DockerEndpoint string
	// contains filtered or unexported fields
}

Postgres is an integration for running postgres tests using docker

func NewPostgres

func NewPostgres(m *testing.M) *Postgres

NewPostgres creates a new integration test for postgres

func NewPostgresWithExit

func NewPostgresWithExit(t *testing.T, code int) *Postgres

NewPostgresWithExit creates a new postgres image with an expected exit

Jump to

Keyboard shortcuts

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