framework

package
v0.0.0-...-a1f2fe4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	// GetName return component name
	GetName() string

	// Bringup doing setup for this component
	// Start() is being called in framework.SetUp()
	Start() error

	// Stop stop this component
	// Stop() is being called in framework.TearDown()
	Stop() error

	// IsAlive check if component is alive/running
	IsAlive() (bool, error)

	// Cleanup clean up tmp files and other resource created by this component
	Cleanup() error
}

Component is a interface of a test component

type IstioTestFramework

type IstioTestFramework struct {
	TestEnv    TestEnv
	TestID     string
	Components []Component
}

IstioTestFramework is core test framework struct

func NewIstioTestFramework

func NewIstioTestFramework(env TestEnv, id string) *IstioTestFramework

NewIstioTestFramework create a IstioTestFramework with a given environment and ID

func (*IstioTestFramework) IsEnvReady

func (framework *IstioTestFramework) IsEnvReady() (bool, error)

IsEnvReady check if the whole environment is ready for running tests

func (*IstioTestFramework) RunTest

func (framework *IstioTestFramework) RunTest(m runnable) (ret int)

RunTest main entry for framework: setup, run tests and clean up

func (*IstioTestFramework) SetUp

func (framework *IstioTestFramework) SetUp() (err error)

SetUp sets up the whole environment as well brings up components

func (*IstioTestFramework) TearDown

func (framework *IstioTestFramework) TearDown()

TearDown stop components and clean up environment

type TestEnv

type TestEnv interface {

	// GetName return environment ID
	GetName() string

	// GetComponents is the key of a environment
	// It defines what components a environment contains.
	// Components will be stored in framework for start and stop
	GetComponents() []Component

	// Bringup doing general setup for environment level, not components.
	// Bringup() is called by framework.SetUp()
	Bringup() error

	// Cleanup clean everything created by this test environment, not component level
	// Cleanup() is being called in framework.TearDown()
	Cleanup() error
}

TestEnv is a interface holding serveral components for testing

Directories

Path Synopsis
component

Jump to

Keyboard shortcuts

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