integration

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 36 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorRequirements = errors.Errorf("missing requirements")

Functions

func InitContainerdWorker added in v0.5.0

func InitContainerdWorker()

func InitDockerdWorker added in v0.8.0

func InitDockerdWorker()

InitDockerdWorker registers a dockerd worker with the global registry.

func InitOCIWorker added in v0.5.0

func InitOCIWorker()

func NewRegistry added in v0.5.0

func NewRegistry(dir string) (url string, cl func() error, err error)

func OfficialImages

func OfficialImages(names ...string) map[string]string

func Register added in v0.5.0

func Register(w Worker)

func Run

func Run(t *testing.T, testCases []Test, opt ...TestOpt)

Types

type Backend added in v0.7.0

type Backend interface {
	Address() string
	ContainerdAddress() string
	Rootless() bool
	Snapshotter() string
}

Backend is the minimal interface that describes a testing backend.

type BackendConfig added in v0.7.0

type BackendConfig struct {
	Logs       map[string]*bytes.Buffer
	ConfigFile string
}

BackendConfig is used to configure backends created by a worker.

type ConfigUpdater added in v0.5.0

type ConfigUpdater interface {
	UpdateConfigFile(string) string
}

type Sandbox

type Sandbox interface {
	Backend

	Cmd(...string) *exec.Cmd
	PrintLogs(*testing.T)
	NewRegistry() (string, error)
	Value(string) interface{} // chosen matrix value
}

type Test

type Test func(*testing.T, Sandbox)

type TestOpt

type TestOpt func(*testConf)

TestOpt is an option that can be used to configure a set of integration tests.

func WithMatrix

func WithMatrix(key string, m map[string]interface{}) TestOpt

func WithMirroredImages

func WithMirroredImages(m map[string]string) TestOpt

type Worker

type Worker interface {
	New(*BackendConfig) (Backend, func() error, error)
	Name() string
}

func List

func List() []Worker

Jump to

Keyboard shortcuts

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