testing

package
v0.15.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 30 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 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