Documentation ¶
Overview ¶
Package testintegration test setup for running testintegration tests using the envtest kubebuilder package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Log is the test logger used by the testintegration tests and server. Log = zap.New(zap.UseFlagOptions(&zap.Options{ Development: true, TimeEncoder: zapcore.ISO8601TimeEncoder, })) )
Functions ¶
func TestContext ¶
TestContext returns a background context that includes appropriate logging configuration.
Types ¶
type EnvTestHarness ¶ added in v1.0.1
type EnvTestHarness struct { // Client is the kubernetes client. Client client.Client // Manager is the manager Manager ctrl.Manager // contains filtered or unexported fields }
EnvTestHarness enables integration tests to control the lifecycle of the operator's controller-manager.
func NewTestHarness ¶ added in v1.0.1
func NewTestHarness() (*EnvTestHarness, error)
NewTestHarness sets up the envtest environment for a testing package. This is intended to be called from `func TestMain(m *testing.M)` so that the environment is configured before
func (*EnvTestHarness) StartManager ¶ added in v1.0.1
func (h *EnvTestHarness) StartManager(proxyImage string) error
StartManager starts up the manager, configuring it with the proxyImage.
func (*EnvTestHarness) StopManager ¶ added in v1.0.1
func (h *EnvTestHarness) StopManager() error
StopManager stops the controller manager and waits for it to exit, returning an error if the controller manager does not stop within 1 minute.
func (*EnvTestHarness) Teardown ¶ added in v1.0.1
func (h *EnvTestHarness) Teardown()
Teardown closes the TestEnv environment at the end of the testcase.