testing

package
v0.19.5 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTestTargetNamespace     = "test"
	DefaultTestCurrentNamespace    = "vcluster"
	DefaultTestVclusterName        = "vcluster"
	DefaultTestVclusterServiceName = "vcluster"
)
View Source
const (
	FakeClientResourceVersion = "999"
)

Variables

This section is empty.

Functions

func CompareObjs added in v0.16.4

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 added in v0.7.0

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

Types

type Compare

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

type NewContextFunc added in v0.7.0

type NewContextFunc func(pClient *testingutil.FakeIndexClient, vClient *testingutil.FakeIndexClient) *synccontext.RegisterContext

type SyncTest

type SyncTest struct {
	Name  string
	Focus bool

	InitialPhysicalState []runtime.Object
	InitialVirtualState  []runtime.Object

	ExpectedPhysicalState map[schema.GroupVersionKind][]runtime.Object
	ExpectedVirtualState  map[schema.GroupVersionKind][]runtime.Object

	Sync    func(ctx *synccontext.RegisterContext)
	Compare Compare
}

func (*SyncTest) Run

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

Jump to

Keyboard shortcuts

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