builder

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AddToManagerFunc

type AddToManagerFunc func(ctrlmgr.Manager) error

AddToManagerFunc is the function controller calls to register itself with the manager passed in

type AddToSchemeFunc

type AddToSchemeFunc func(*runtime.Scheme) error

AddToScheme is the function TestSuite calls to register schemes for a manager

type IntegrationTestContext

type IntegrationTestContext struct {
	context.Context
	Client    client.Client
	AviClient aviclient.FakeAviClient
	Namespace string
	// contains filtered or unexported fields
}

IntegrationTestContext is used for integration testing. Each IntegrationTestContext contains one separate namespace

func (*IntegrationTestContext) AfterEach

func (ctx *IntegrationTestContext) AfterEach()

AfterEach should be invoked by ginkgo.AfterEach to destroy the test namespace

func (*IntegrationTestContext) GetLogger

func (*IntegrationTestContext) GetLogger() logr.Logger

type NewReconcilerFunc

type NewReconcilerFunc func() Reconciler

NewReconcilerFunc is a base type for functions that return a reconciler

type Reconciler

type Reconciler interface{}

Reconciler is a base type for builder's reconcilers

type TestSuite

type TestSuite struct {
	context.Context
	// contains filtered or unexported fields
}

TestSuite is used for unit and integration testing builder. Each TestSuite contains one independent test environment and a controller manager

func NewTestSuiteForController

func NewTestSuiteForController(addToManagerFn AddToManagerFunc, addToSchemeFn AddToSchemeFunc, crdpaths ...string) *TestSuite

NewTestSuiteForController returns a new test suite used for integration test

func NewTestSuiteForReconciler

func NewTestSuiteForReconciler(addToManagerFn AddToManagerFunc, addToSchemeFn AddToSchemeFunc, crdpaths ...string) *TestSuite

NewTestSuiteForReconciler returns a new test suite used for integration test

func (*TestSuite) AfterSuite

func (s *TestSuite) AfterSuite()

AfterSuite should be invoked by ginkgo.AfterSuite.

func (*TestSuite) BeforeSuite

func (s *TestSuite) BeforeSuite()

BeforeSuite should be invoked by ginkgo.BeforeSuite.

func (*TestSuite) GetEnvTestConfg

func (s *TestSuite) GetEnvTestConfg() *rest.Config

func (*TestSuite) GetManager

func (s *TestSuite) GetManager() manager.Manager

func (*TestSuite) NewIntegrationTestContext

func (s *TestSuite) NewIntegrationTestContext() *IntegrationTestContext

NewIntegrationTestContext should be invoked by ginkgo.BeforeEach

This function creates a namespace with a random name to separate integration test cases

This function returns a TestSuite context The resources created by this function may be cleaned up by calling AfterEach with the IntegrationTestContext returned by this function

func (*TestSuite) Register

func (s *TestSuite) Register(t *testing.T, name string, runIntegrationTestsFn, runUnitTestsFn func())

Register should be invoked by the function to which *testing.T is passed.

Use runUnitTestsFn to pass a function that will be invoked if unit testing is enabled with Describe("Unit tests", runUnitTestsFn).

Use runIntegrationTestsFn to pass a function that will be invoked if integration testing is enabled with Describe("Unit tests", runIntegrationTestsFn).

Jump to

Keyboard shortcuts

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