test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNamespace            = "default"
	TestAssetUseExistingCluster = "USE_EXISTING_CLUSTER"
)

Variables

View Source
var DefaultRetry = wait.Backoff{
	Steps:    500,
	Duration: 10 * time.Millisecond,
	Factor:   1.0,
	Jitter:   0.1,
}

DefaultRetry is the recommended retry parameters for unit testing scenarios where a condition is being tested multiple times before it is expected to succeed.

Functions

func CRDs

func CRDs() string

CRDs path to project crds location

func CheckCRDFiles

func CheckCRDFiles(crds []string) ([]string, error)

CheckCRDFiles - validates that all crds files are found.

func Expand

func Expand(path string) ([]string, error)

Expand recursively and returns list of all sub-directories (if any)

func UseExistingCluster

func UseExistingCluster() bool

UseExistingCluster - checks if USE_EXISTING_CLUSTER environment variable is set

Types

type TestEnv

type TestEnv struct {
	envtest.Environment
	// contains filtered or unexported fields
}

TestEnv - wrapper for controller-runtime envtest with additional functionality

func NewTestEnv

func NewTestEnv(namespace string, crds ...string) *TestEnv

NewTestEnv - create new test environment instance

func (*TestEnv) Start

func (te *TestEnv) Start() *rest.Config

Start - starts and bootstraps test environment ang returns Kubernetes config instance

func (*TestEnv) Stop

func (te *TestEnv) Stop()

Stop - stops test environment performing additional cleanup (if needed)

func (*TestEnv) StopAndExit

func (te *TestEnv) StopAndExit(code int)

StopAndExit - stops and exists, typically used as a last call in TestMain

Jump to

Keyboard shortcuts

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