testing

package
v0.20.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 32 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 NewFakeConfig added in v0.20.0

func NewFakeConfig() *config.VirtualClusterConfig

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 {
	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
	Focus                 bool
}

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