testing

package
v0.21.0-alpha.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FakeClientResourceVersion = "999"
)

Variables

This section is empty.

Functions

func CompareObjs

func CompareObjs(ctx context.Context, t *testing.T, state string, c client.Client, gvk schema.GroupVersionKind, scheme *runtime.Scheme, objs []runtime.Object, compare Compare) error

func RunTests

func RunTests(t *testing.T, tests []*SyncTest)

func RunTestsWithContext

func RunTestsWithContext(t *testing.T, createContext NewContextFunc, tests []*SyncTest)

Types

type Compare

type Compare func(obj1 runtime.Object, obj2 runtime.Object) bool

type SyncTest

type SyncTest struct {
	ExpectedPhysicalState map[schema.GroupVersionKind][]runtime.Object
	ExpectedVirtualState  map[schema.GroupVersionKind][]runtime.Object
	Sync                  func(ctx *synccontext.RegisterContext)
	Compare               Compare
	Name                  string
	InitialPhysicalState  []runtime.Object
	InitialVirtualState   []runtime.Object
	AdjustConfig          func(vConfig *config.VirtualClusterConfig)
	// contains filtered or unexported fields
}

func (*SyncTest) Run

func (s *SyncTest) Run(t *testing.T, createContext NewContextFunc)

func (*SyncTest) Validate

func (s *SyncTest) Validate(t *testing.T)

Jump to

Keyboard shortcuts

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