testutil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEvents

func AssertEvents(events chan string, expected map[string]int)

AssertEvents asserts that the expected events were recorded in the events channel.

func EnsureNoEvents

func EnsureNoEvents(events chan string)

EnsureNoEvents ensures that all events are consumed from the events channel.

func NewSpecFiller added in v0.0.3

func NewSpecFiller(data []byte) *randfill.Filler

NewSpecFiller creates a new randfill.Filler from go-fuzz data, with custom functions to handle specific fields that require special handling.

func ReconcileStatefulSets

func ReconcileStatefulSets[T interface {
	SpecificName() string
}](ctx context.Context, cr T, suite TestSuit)

ReconcileStatefulSets updates the status of all StatefulSets associated with the given Cluster.

Types

type TestSuit

type TestSuit struct {
	TestEnv *envtest.Environment
	Cfg     *rest.Config
	Client  client.Client
	Log     controllerutil.Logger
}

TestSuit encapsulates the testing environment and utilities.

func SetupEnvironment

func SetupEnvironment(addToScheme func(*k8sruntime.Scheme) error) TestSuit

SetupEnvironment initializes the test environment, including the Kubernetes API server and etcd.

Jump to

Keyboard shortcuts

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