helpers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package helpers provides helper functions to run integration tests by pre-populating the required settings for envtest and loading required crds from different modules

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestEnvironment

type TestEnvironment struct {
	manager.Manager
	client.Client
	Config        *rest.Config
	ProxmoxClient proxmox.Client
	WebhookConfig WebhookConfig
	// contains filtered or unexported fields
}

TestEnvironment is used to wrap the testing setup for integration tests.

func NewTestEnvironment

func NewTestEnvironment(setupWebhook bool, pmClient proxmox.Client) *TestEnvironment

NewTestEnvironment creates a new testing environment with a pre-configured manager, that can be used to register reconcilers.

func (*TestEnvironment) GetContext

func (t *TestEnvironment) GetContext() context.Context

GetContext returns the context of the test environment. This context will be initialized once `StartManager` was called.

func (*TestEnvironment) StartManager

func (t *TestEnvironment) StartManager(ctx context.Context) error

StartManager starts the manager.

func (*TestEnvironment) Stop

func (t *TestEnvironment) Stop() error

Stop shuts down the test environment and stops the manager.

type WebhookConfig

type WebhookConfig struct {
	Host string
	Port int
}

WebhookConfig contains host and port for the env test webhook serving address.

Jump to

Keyboard shortcuts

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