test

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommand

func GetCommand() *cobra.Command

GetCommand returns the test command

func Main

func Main()

Main runs a test

func Register

func Register(name string, suite TestingSuite)

Register registers a test suite Deprecated: Use registry.RegisterTestSuite instead

func Run

func Run() error

Run runs a test

func RunTests

func RunTests(t *testing.T, suite TestingSuite, config *Config)

RunTests runs a test suite

Types

type AfterTest

type AfterTest interface {
	AfterTest(testName string)
}

AfterTest is an interface for executing code after every test

type BeforeTest

type BeforeTest interface {
	BeforeTest(testName string)
}

BeforeTest is an interface for executing code before every test

type Config

type Config struct {
	ID              string
	Image           string
	ImagePullPolicy corev1.PullPolicy
	Suites          []string
	Tests           []string
	Env             map[string]string
	Timeout         time.Duration
	Iterations      int
	Verbose         bool
}

Config is a test configuration

func GetConfigFromEnv

func GetConfigFromEnv() *Config

GetConfigFromEnv returns the test configuration from the environment

func (*Config) ToEnv

func (c *Config) ToEnv() map[string]string

ToEnv returns the configuration as a mapping of environment variables

type Coordinator

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

Coordinator coordinates workers for suites of tests

func (*Coordinator) Run

func (c *Coordinator) Run() error

Run runs the tests

type SetupTest

type SetupTest interface {
	SetupTest()
}

SetupTest is an interface for setting up individual tests

type SetupTestSuite

type SetupTestSuite interface {
	SetupTestSuite()
}

SetupTestSuite is an interface for setting up a suite of tests

type Suite

type Suite struct{}

Suite is an identifier interface for test suites

type TearDownTest

type TearDownTest interface {
	TearDownTest()
}

TearDownTest is an interface for tearing down individual tests

type TearDownTestSuite

type TearDownTestSuite interface {
	TearDownTestSuite()
}

TearDownTestSuite is an interface for tearing down a suite of tests

type TestingSuite

type TestingSuite interface{}

TestingSuite is a suite of tests

type Worker

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

Worker runs a test job

func (*Worker) Run

func (w *Worker) Run() error

Run runs a test

type WorkerTask

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

WorkerTask manages a single test job for a test worker

func (*WorkerTask) Run

func (t *WorkerTask) Run() (int, error)

Run runs the worker job

Jump to

Keyboard shortcuts

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