goit

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 8 Imported by: 0

README

goit - Go Integration Tests

goit library helps writing integration tests using dockertest library

Documentation

Index

Constants

This section is empty.

Variables

We need these public variables to share information betwee TestMain and OtherTests, if you have a better idea, tell me

Functions

func Run added in v0.3.0

func Run(m *testing.M) int

func Start

func Start(ctx context.Context, containers ...Container)

func StartWithOptions added in v0.2.0

func StartWithOptions(ctx context.Context, opt Options, containers ...Container)

Start the integration test environment

func Stop

func Stop()

Stop the integration test environment

Types

type Container

type Container interface {

	// Executed after the container is started, use it to run migrations
	// copy files, etc
	AfterStart(context.Context, *dockertest.Resource) error
}

Container represents a docker container

type ContainerParams added in v0.2.0

type ContainerParams struct {
	Repository string
	Tag        string
	Env        []string
}

func (ContainerParams) GetRepoTag added in v0.2.0

func (p ContainerParams) GetRepoTag(defaultRepo, defaultTag string) (repo, tag string)

func (ContainerParams) MergeEnv added in v0.2.0

func (p ContainerParams) MergeEnv(env []string) []string

type Options added in v0.2.0

type Options struct {
	// AutoRemoveContainers set the containers to remove itself when finished, e.g. docker run --rm
	AutoRemoveContainers bool

	// RestartContainers define if a container must restart after it is finished
	RestartContainers bool

	// ExpireContainersAfterSeconds sets a container to be destroid after an amount of seconds
	ExpireContainersAfterSeconds uint
}

func DefaultOptions added in v0.4.0

func DefaultOptions() Options

Directories

Path Synopsis
examples
dockerfile command

Jump to

Keyboard shortcuts

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