testutil

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Backoff = wait.Backoff{
	Steps:    10,
	Duration: 10 * time.Millisecond,
	Factor:   2.0,
	Jitter:   0.1,
	Cap:      time.Minute,
}

Functions

func AtLeastVersion

func AtLeastVersion(t *testing.T, minor int) bool

func Eventually

func Eventually(t testing.TB, fn func() bool)

func NewClient

func NewClient(t testing.TB, objs ...client.Object) client.Client

func NewClientWithInterceptors

func NewClientWithInterceptors(t testing.TB, ict *interceptor.Funcs, objs ...client.Object) client.Client

func NewContext

func NewContext(t *testing.T) context.Context

func NewReadOnlyClient added in v0.0.6

func NewReadOnlyClient(t testing.TB, objs ...runtime.Object) client.Client

func SomewhatEventually

func SomewhatEventually(t testing.TB, dur time.Duration, fn func() bool)

func WithFakeExecutor added in v0.0.10

func WithFakeExecutor(t *testing.T, mgr *Manager, sh execution.SynthesizerHandle)

Types

type Manager

type Manager struct {
	ctrl.Manager
	RestConfig           *rest.Config
	DownstreamRestConfig *rest.Config  // may or may not == RestConfig
	DownstreamClient     client.Client // may or may not == Manager.GetClient()
	DownstreamEnv        *envtest.Environment
	DownstreamVersion    int

	// NoSsaSupport is true if the cluster does not support server-side-apply
	NoSsaSupport bool
}

func NewManager

func NewManager(t *testing.T, testOpts ...TestManagerOption) *Manager

NewManager starts one or two envtest environments depending on the env. This should work seamlessly when run locally assuming binaries have been fetched with setup-envtest. In CI the second environment is used to compatibility test against a matrix of k8s versions. This compatibility testing is tightly coupled to the github action and not expected to work locally.

func (*Manager) GetCurrentResourceSlices added in v0.0.2

func (m *Manager) GetCurrentResourceSlices(ctx context.Context) ([]*apiv1.ResourceSlice, error)

func (*Manager) Start

func (m *Manager) Start(t *testing.T)

type TestManagerOption added in v0.0.4

type TestManagerOption func(*manager.Options)

func WithCompositionNamespace added in v0.0.6

func WithCompositionNamespace(ns string) TestManagerOption

func WithPodNamespace added in v0.0.4

func WithPodNamespace(ns string) TestManagerOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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