testintegration

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package testintegration test setup for running testintegration tests using the envtest kubebuilder package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Log is the test logger used by the testintegration tests and server.
	Log = zap.New(zap.UseFlagOptions(&zap.Options{
		Development: true,
		TimeEncoder: zapcore.ISO8601TimeEncoder,
	}))
)

Functions

func TestContext

func TestContext() context.Context

TestContext returns a background context that includes appropriate logging configuration.

Types

type EnvTestHarness added in v1.0.1

type EnvTestHarness struct {

	// Client is the kubernetes client.
	Client client.Client

	// Manager is the manager
	Manager ctrl.Manager
	// contains filtered or unexported fields
}

EnvTestHarness enables integration tests to control the lifecycle of the operator's controller-manager.

func NewTestHarness added in v1.0.1

func NewTestHarness() (*EnvTestHarness, error)

NewTestHarness sets up the envtest environment for a testing package. This is intended to be called from `func TestMain(m *testing.M)` so that the environment is configured before

func (*EnvTestHarness) StartManager added in v1.0.1

func (h *EnvTestHarness) StartManager(proxyImage string) error

StartManager starts up the manager, configuring it with the proxyImage.

func (*EnvTestHarness) StopManager added in v1.0.1

func (h *EnvTestHarness) StopManager() error

StopManager stops the controller manager and waits for it to exit, returning an error if the controller manager does not stop within 1 minute.

func (*EnvTestHarness) Teardown added in v1.0.1

func (h *EnvTestHarness) Teardown()

Teardown closes the TestEnv environment at the end of the testcase.

Jump to

Keyboard shortcuts

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