integration

package module
v0.0.0-...-87db18b Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

README

go-integration

NOTE: this is only a POC. Use only if you know what you are doing

Integration test framework for Go.

Usage

Check out ./example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCleanup

func WithCleanup(svc *Service)

func WithCriu

func WithCriu(svc *Service)

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(name string, image string, opts ...ServiceOption) *Service

func (*Service) Hostname

func (svc *Service) Hostname() string

func (*Service) IsRunning

func (svc *Service) IsRunning() (bool, error)

func (*Service) Start

func (svc *Service) Start() error

func (*Service) Stop

func (svc *Service) Stop() error

type ServiceOption

type ServiceOption func(*Service)

func WithEnv

func WithEnv(v []string) ServiceOption

func WithMounts

func WithMounts(m []specs.Mount) ServiceOption

func WithSetup

func WithSetup(setup func(svc *Service) error) ServiceOption

func WithStopTimeout

func WithStopTimeout(timeout time.Duration) ServiceOption

func WithWait

func WithWait(wait func(svc *Service) error, timeout time.Duration) ServiceOption

type Test

type Test struct {
	// contains filtered or unexported fields
}

func NewIntegrationTest

func NewIntegrationTest(t *testing.T, opts ...TestOption) *Test

func (*Test) Run

func (it *Test) Run(f func(ctx context.Context, t *testing.T))

type TestOption

type TestOption func(*Test)

func DependsOn

func DependsOn(svc *Service) TestOption

type WaitOption

type WaitOption struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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