Documentation ¶
Index ¶
- Variables
- type AddToManagerFunc
- type AddToSchemeFunc
- type IntegrationTestContext
- type NewReconcilerFunc
- type Reconciler
- type TestSuite
- func (s *TestSuite) AfterSuite()
- func (s *TestSuite) BeforeSuite()
- func (s *TestSuite) GetEnvTestConfg() *rest.Config
- func (s *TestSuite) GetManager() manager.Manager
- func (s *TestSuite) NewIntegrationTestContext() *IntegrationTestContext
- func (s *TestSuite) Register(t *testing.T, name string, runIntegrationTestsFn, runUnitTestsFn func())
Constants ¶
This section is empty.
Variables ¶
var FakeAvi *aviclient.FakeAviClient
Functions ¶
This section is empty.
Types ¶
type AddToManagerFunc ¶
AddToManagerFunc is the function controller calls to register itself with the manager passed in
type AddToSchemeFunc ¶
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 TestSuite ¶
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 (*TestSuite) GetManager ¶
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).