config

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config contains the e2e test configuration.

Index

Constants

View Source
const LabelTestSuite = "test-suite"

LabelTestSuite is used to define the suite each test should be part of.

View Source
const TestSuiteDefault = "base"

TestSuiteDefault is the default suite's key and value for LabelTestSuite.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	env.Environment
	// contains filtered or unexported fields
}

Environment is these e2e test configuration, wraps the e2e-framework environment.

func NewEnvironmentFromFlags

func NewEnvironmentFromFlags() Environment

NewEnvironmentFromFlags creates a new e2e test configuration, setting up the flags, but not parsing them yet, which is left to the caller to do.

func (*Environment) AddDefaultTestSuite

func (e *Environment) AddDefaultTestSuite(opts ...TestSuiteOpt)

AddDefaultTestSuite adds the default suite, panics if already defined.

func (*Environment) AddTestSuite

func (e *Environment) AddTestSuite(name string, opts ...TestSuiteOpt)

AddTestSuite adds a new test suite, panics if already defined.

func (*Environment) EnrichLabels

func (e *Environment) EnrichLabels(labels features.Labels) features.Labels

EnrichLabels returns the provided labels enriched with the selected suite labels, preserving user-specified ones in case of key conflicts.

func (*Environment) GetKindClusterLogsLocation

func (e *Environment) GetKindClusterLogsLocation() string

GetKindClusterLogsLocation returns the location of the kind cluster logs.

func (*Environment) GetKindClusterName

func (e *Environment) GetKindClusterName() string

GetKindClusterName returns the name of the kind cluster, returns empty string if it's not a kind cluster.

func (*Environment) GetSelectedSuiteAdditionalEnvSetup

func (e *Environment) GetSelectedSuiteAdditionalEnvSetup() (out []env.Func)

GetSelectedSuiteAdditionalEnvSetup returns the additional env setup funcs for the selected suite, to be run before installing Crossplane, if required.

func (*Environment) GetSelectedSuiteInstallOpts

func (e *Environment) GetSelectedSuiteInstallOpts(extra ...helm.Option) []helm.Option

GetSelectedSuiteInstallOpts returns the helm install options for the selected suite, appending additional specified ones.

func (*Environment) HelmInstallBaseCrossplane

func (e *Environment) HelmInstallBaseCrossplane() env.Func

HelmInstallBaseCrossplane returns a features.Func that installs crossplane using the default suite's helm install options.

func (*Environment) HelmOptions

func (e *Environment) HelmOptions(extra ...helm.Option) []helm.Option

HelmOptions valid for installing and upgrading the Crossplane Helm chart. Used to install Crossplane before any test starts, but some tests also use these options - for example to reinstall Crossplane with a feature flag enabled.

func (*Environment) HelmOptionsToSuite

func (e *Environment) HelmOptionsToSuite(suite string, extra ...helm.Option) []helm.Option

HelmOptionsToSuite returns the Helm options for the specified suite, appending additional specified ones.

func (*Environment) HelmUpgradeCrossplaneToBase

func (e *Environment) HelmUpgradeCrossplaneToBase() env.Func

HelmUpgradeCrossplaneToBase returns a features.Func that upgrades crossplane using the specified suite's helm install options.

func (*Environment) HelmUpgradeCrossplaneToSuite

func (e *Environment) HelmUpgradeCrossplaneToSuite(suite string, extra ...helm.Option) env.Func

HelmUpgradeCrossplaneToSuite returns a features.Func that upgrades crossplane using the specified suite's helm install options.

func (*Environment) IsKindCluster

func (e *Environment) IsKindCluster() bool

IsKindCluster returns true if the test is running against a kind cluster.

func (*Environment) SetEnvironment

func (e *Environment) SetEnvironment(env env.Environment)

SetEnvironment sets the environment to be used by the e2e test configuration.

func (*Environment) ShouldCollectKindLogsOnFailure

func (e *Environment) ShouldCollectKindLogsOnFailure() bool

ShouldCollectKindLogsOnFailure returns true if the test should collect the kind cluster logs on failure.

func (*Environment) ShouldDestroyKindCluster

func (e *Environment) ShouldDestroyKindCluster() bool

ShouldDestroyKindCluster returns true if the test should destroy the kind cluster after finishing.

func (*Environment) ShouldInstallCrossplane

func (e *Environment) ShouldInstallCrossplane() bool

ShouldInstallCrossplane returns true if the test should install Crossplane before starting.

func (*Environment) ShouldLoadImages

func (e *Environment) ShouldLoadImages() bool

ShouldLoadImages returns true if the test should load images into the kind cluster.

type TestSuiteOpt

type TestSuiteOpt func(*testSuite)

TestSuiteOpt is an option to midify a testSuite.

func WithConditionalEnvSetupFuncs

func WithConditionalEnvSetupFuncs(condition func() bool, funcs ...env.Func) TestSuiteOpt

WithConditionalEnvSetupFuncs sets the provided testSuite to include the provided env setup funcs, if the condition is true, when evaluated.

func WithHelmInstallOpts

func WithHelmInstallOpts(opts ...helm.Option) TestSuiteOpt

WithHelmInstallOpts sets the provided testSuite to include the provided helm install options.

func WithLabelsToSelect

func WithLabelsToSelect(labels features.Labels) TestSuiteOpt

WithLabelsToSelect sets the provided testSuite to include the provided labels, if not already specified by the user.

func WithoutBaseDefaultTestSuite

func WithoutBaseDefaultTestSuite() TestSuiteOpt

WithoutBaseDefaultTestSuite sets the provided testSuite to not include the base one.

Jump to

Keyboard shortcuts

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