envtest

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateObjs added in v0.12.0

func CreateObjs(ctx context.Context, t testing.TB, c client.Client, objs ...Object)

CreateObjs creates Objects using the provided kube client and waits until its cache has been updated with those objects

func RunWithEnvironment

func RunWithEnvironment(m *testing.M, opts ...EnvironmentOpt) int

RunWithEnvironment runs a suite of tests with an envtest that is shared across all tests We use testing.M as the input to avoid having this called directly from a test This ensures the envtest setup is always run from a TestMain

Types

type Environment

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

func (*Environment) APIReader

func (e *Environment) APIReader() client.Reader

APIReader returns a non cached reader client

func (*Environment) Client

func (e *Environment) Client() client.Client

func (*Environment) CreateNamespaceForTest

func (e *Environment) CreateNamespaceForTest(ctx context.Context, t *testing.T) string

func (*Environment) Manager added in v0.9.2

func (e *Environment) Manager() manager.Manager

Manager returns a Manager for the test environment

type EnvironmentOpt

type EnvironmentOpt func(ctx context.Context, e *Environment)

func WithAssignment

func WithAssignment(envRef **Environment) EnvironmentOpt

type Object added in v0.12.0

type Object client.Object

Jump to

Keyboard shortcuts

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