envtest

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Jump to

Keyboard shortcuts

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