e2etestenv

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package e2etestenv provides a test environment for end-to-end tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(ctx context.Context, opts ...SetupOption) (client.Client, error)

Setup sets up the test environment for the e2e tests, starting kind and installing the necessary components.

Types

type SetupOption

type SetupOption func(*SetupOptions)

SetupOption is a function that sets up an option for the test environment setup.

func WithCNPGImageName

func WithCNPGImageName(name string) SetupOption

WithCNPGImageName sets the CloudNativePG image name for the test environment.

func WithCNPGImageTag

func WithCNPGImageTag(tag string) SetupOption

WithCNPGImageTag sets the CloudNativePG image tag for the test environment.

func WithCNPGKustomizationRef

func WithCNPGKustomizationRef(ref string) SetupOption

WithCNPGKustomizationRef sets the CloudNativePG kustomization ref for the test environment.

func WithCNPGKustomizationTimeout

func WithCNPGKustomizationTimeout(timeout string) SetupOption

WithCNPGKustomizationTimeout sets the CloudNativePG kustomization timeout for the test environment.

func WithCNPGKustomizationURL

func WithCNPGKustomizationURL(url string) SetupOption

WithCNPGKustomizationURL sets the CloudNativePG kustomization URL for the test environment.

func WithCertManagerVersion

func WithCertManagerVersion(version string) SetupOption

WithCertManagerVersion sets the cert-manager version for the test environment.

func WithIgnoreExistingResources

func WithIgnoreExistingResources(ignore bool) SetupOption

WithIgnoreExistingResources sets the option to ignore existing resources when creating the test environment, instead of returning an error.

func WithK8sVersion

func WithK8sVersion(version string) SetupOption

WithK8sVersion sets the Kubernetes version for the test environment.

func WithKindAdditionalNetworks

func WithKindAdditionalNetworks(networks []string) SetupOption

WithKindAdditionalNetworks sets the additional networks for the Kind cluster for the test environment.

func WithKindVersion

func WithKindVersion(version string) SetupOption

WithKindVersion sets the Kind version for the test environment.

type SetupOptions

type SetupOptions struct {
	K8sVersion string

	KindVersion            string
	KindClusterNamePrefix  string
	KindAdditionalNetworks []string

	CNPGKustomizationURL     string
	CNPGKustomizationRef     string
	CNPGKustomizationTimeout string
	CNPGImageName            string
	CNPGImageTag             string

	CertManagerVersion string

	IgnoreExistingResources bool
}

SetupOptions contains the options for setting up the test environment.

Jump to

Keyboard shortcuts

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