testutils

package module
v0.0.0-...-e8d3b3d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupResources

func CleanupResources(g gomega.Gomega, ctx context.Context, cfg *rest.Config, k8sClient client.Client, namespace string, objs ...client.Object)

CleanupResources will clean up resources of the types of objects given in a particular namespace if given. The namespace will then be removed once it has been emptied. This utility is intended to be used in AfterEach blocks to clean up from a specific test. It calls various gomega assertions so will fail a test if there are any errors.

func MatchClusterOperatorStatusCondition

func MatchClusterOperatorStatusCondition(expected configv1.ClusterOperatorStatusCondition) types.GomegaMatcher

MatchClusterOperatorStatusCondition returns a custom matcher to check equality of configv1.ClusterOperatorStatusCondition.

func MatchClusterOperatorStatusConditions

func MatchClusterOperatorStatusConditions(expected []configv1.ClusterOperatorStatusCondition) types.GomegaMatcher

MatchClusterOperatorStatusConditions returns a custom matcher to check equality of configv1.ClusterOperatorStatusConditions.

func MatchCondition

func MatchCondition(expected metav1.Condition) types.GomegaMatcher

MatchCondition returns a custom matcher to check equality of metav1.Condition.

func MatchConditions

func MatchConditions(expected []metav1.Condition) types.GomegaMatcher

MatchConditions returns a custom matcher to check equality of a slice of metav1.Condtion.

Types

type LogEntry

type LogEntry struct {
	// Error is the error passed to an error log line.
	Error error

	// KeysAndValues are the keys and values that were logged with
	// the log line.
	KeysAndValues []interface{}

	// Level is the level of the info log line.
	Level int

	// Messages is the message from the log line.
	Message string
}

LogEntry captures the information about a particular log line.

type TestLogger

type TestLogger interface {
	Entries() []LogEntry
	Logger() logr.Logger
}

TestLogger provides a logr.Logger and access to a list of log entries logged via the logger.

func NewTestLogger

func NewTestLogger() TestLogger

NewTestLogger constructs a new TestLogger.

Directories

Path Synopsis
machine/v1
Linter warns about duplicated code with OpenStack, GCP, and Azure FailureDomains builders.
Linter warns about duplicated code with OpenStack, GCP, and Azure FailureDomains builders.

Jump to

Keyboard shortcuts

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