testrunner

package
v1.98.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAll

func RunAll(t *testing.T, mgr manager.Manager, shouldRunFunc ShouldRunFunc, testCaseFunc TestCaseFunc)

func RunAllWithDependenciesCreatedButNotObject

func RunAllWithDependenciesCreatedButNotObject(t *testing.T, mgr manager.Manager, shouldRunFunc ShouldRunFunc, testCaseFunc TestCaseFunc)

func RunAllWithObjectCreated

func RunAllWithObjectCreated(t *testing.T, mgr manager.Manager, shouldRunFunc ShouldRunFunc, testCaseFunc TestCaseFunc)

func RunSpecific

func RunSpecific(t *testing.T, fixture []resourcefixture.ResourceFixture, testCaseFunc func(t *testing.T, testContext TestContext))

Types

type ShouldRunFunc

type ShouldRunFunc func(fixture resourcefixture.ResourceFixture, mgr manager.Manager) bool

type SystemContext

type SystemContext struct {
	Manager      manager.Manager
	SMLoader     *servicemappingloader.ServiceMappingLoader
	Reconciler   *testreconciler.TestReconciler
	TFProvider   *schema.Provider
	DCLConfig    *mmdcl.Config
	DCLConverter *dclconversion.Converter
}

type TestCaseFunc

type TestCaseFunc func(t *testing.T, testContext TestContext, sysContext SystemContext)

type TestContext

type TestContext struct {
	CreateUnstruct      *unstructured.Unstructured
	UpdateUnstruct      *unstructured.Unstructured
	DependencyUnstructs []*unstructured.Unstructured
	ResourceFixture     resourcefixture.ResourceFixture
	NamespacedName      types.NamespacedName
	UniqueId            string
}

func NewTestContext

func NewTestContext(t *testing.T, fixture resourcefixture.ResourceFixture, projectId string) TestContext

NewTestContext takes a resource fixture and returns a filled out TestContext The resources in the fixture are converted to unstructured.Unstructured and their namespaces are set equal to a unique generated id.

Jump to

Keyboard shortcuts

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