helpers

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eventually

func Eventually(t TestingT, condition func() (success bool, reason string), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{})

Eventually asserts that given condition will be met in waitFor time, periodically checking target function each tick. In addition to require.Eventually, this function t.Logs the reason string value returned by the condition function (eventually after 20% of the wait time) to aid in debugging.

func EventuallyCondition

func EventuallyCondition(t TestingT, getter func() (conditions.Getter, error), evaluator *ConditionEvaluator, msgAndArgs ...interface{})

EventuallyCondition asserts that the object returned by getter() eventually has a condition that matches the evaluator.

func EventuallyReady

func EventuallyReady(t TestingT, getter func() (conditions.Getter, error), msgAndArgs ...interface{})

EventuallyReady asserts that the object returned by getter() eventually has a ready condition.

func LoadKubeConfig

func LoadKubeConfig(kubeconfigPath, contextName string) (clientcmd.ClientConfig, error)

LoadKubeConfig loads a kubeconfig from disk. This method is intended to be common between fixture for servers whose lifecycle is test-managed and fixture for servers whose lifecycle is managed separately from a test run.

func RepositoryBinDir

func RepositoryBinDir() string

RepositoryBinDir returns the absolute path of <repo-dir>/bin. That's where `make build` produces our binaries.

func RepositoryDir

func RepositoryDir() string

RepositoryDir returns the absolute path of kcp-dev/kcp repository on disk.

Types

type ConditionEvaluator

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

func IsNot

func (*ConditionEvaluator) WithReason

func (c *ConditionEvaluator) WithReason(reason string) *ConditionEvaluator

type TestingT

type TestingT interface {
	Cleanup(func())
	Errorf(format string, args ...any)
	FailNow()
	Helper()
	Log(args ...any)
	Logf(format string, args ...any)
}

TestingT is implemented by *testing.T and potentially other test frameworks.

Jump to

Keyboard shortcuts

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