envconf

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 64

Documentation

Overview

Package envconf stores configuration for a test environment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomName

func RandomName(prefix string, n int) string

RandomName generates a random name of n length with the provided prefix. If prefix is omitted, the then entire name is random char.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config represents and environment configuration

func New

func New() *Config

New creates and initializes an empty environment configuration

func NewFromFlags

func NewFromFlags() (*Config, error)

NewFromFlags initializes an environment config using flag values parsed from command-line arguments and returns an error on parsing failure.

func NewWithKubeConfig added in v0.0.4

func NewWithKubeConfig(kubeconfig string) *Config

NewWithKubeConfig creates and initializes an empty environment configuration

func (*Config) AssessmentRegex

func (c *Config) AssessmentRegex() *regexp.Regexp

AssessmentRegex returns the environment assessment filter

func (*Config) Client

func (c *Config) Client() klient.Client

Client is a constructor function that returns a previously created klient.Client or creates a new one based on configuration previously set. Will panic on any error so it is recommended that you are confident in the configuration or call NewClient() to ensure its safe creation.

func (*Config) DisableGracefulTeardown added in v0.0.8

func (c *Config) DisableGracefulTeardown() bool

DisableGracefulTeardown is used to check the panic recovery handler should be enabled

func (*Config) DryRunMode added in v0.0.7

func (c *Config) DryRunMode() bool

func (*Config) FailFast added in v0.0.7

func (c *Config) FailFast() bool

FailFast indicate if the framework is running in fail fast mode. This controls the behavior of how the assessments and features are handled if a test encounters a failure result

func (*Config) FeatureRegex

func (c *Config) FeatureRegex() *regexp.Regexp

FeatureRegex returns the environment's feature regex filter

func (*Config) KubeContext added in v0.2.0

func (c *Config) KubeContext() string

WithKubeContext is used to get the kubeconfig context

func (*Config) KubeconfigFile added in v0.0.4

func (c *Config) KubeconfigFile() string

func (*Config) Labels

func (c *Config) Labels() map[string][]string

Labels returns the environment's label filters

func (*Config) Namespace

func (c *Config) Namespace() string

Namespace returns the namespace for the environment

func (*Config) NewClient added in v0.0.4

func (c *Config) NewClient() (klient.Client, error)

NewClient is a constructor function that returns a previously created klient.Client or create a new one based on configuration previously set. Will return an error if unable to do so.

func (*Config) ParallelTestEnabled added in v0.0.6

func (c *Config) ParallelTestEnabled() bool

ParallelTestEnabled indicates if the test features are being run in parallel or not

func (*Config) SkipAssessmentRegex added in v0.0.4

func (c *Config) SkipAssessmentRegex() *regexp.Regexp

SkipAssessmentRegex returns the environment assessment filter

func (*Config) SkipFeatureRegex added in v0.0.4

func (c *Config) SkipFeatureRegex() *regexp.Regexp

SkipFeatureRegex returns the environment's skipfeature regex filter

func (*Config) SkipLabels added in v0.0.4

func (c *Config) SkipLabels() map[string][]string

SkipLabels returns the environment's label filters

func (*Config) WithAssessmentRegex

func (c *Config) WithAssessmentRegex(regex string) *Config

WithAssessmentRegex sets the environment assessment regex filter

func (*Config) WithClient

func (c *Config) WithClient(client klient.Client) *Config

WithClient used to update the environment klient.Client

func (*Config) WithDisableGracefulTeardown added in v0.0.8

func (c *Config) WithDisableGracefulTeardown() *Config

WithDisableGracefulTeardown can be used to programmatically disabled the panic recovery enablement on test startup. This will prevent test Finish steps from being executed on panic

func (*Config) WithDryRunMode added in v0.0.7

func (c *Config) WithDryRunMode() *Config

func (*Config) WithFailFast added in v0.0.7

func (c *Config) WithFailFast() *Config

WithFailFast can be used to enable framework specific fail fast mode that controls the test execution of the features and assessments under test

func (*Config) WithFeatureRegex

func (c *Config) WithFeatureRegex(regex string) *Config

WithFeatureRegex sets the environment's feature regex filter

func (*Config) WithKubeContext added in v0.2.0

func (c *Config) WithKubeContext(kubeContext string) *Config

WithKubeContext is used to set the kubeconfig context

func (*Config) WithKubeconfigFile added in v0.0.3

func (c *Config) WithKubeconfigFile(kubecfg string) *Config

WithKubeconfigFile creates a new klient.Client and injects it in the cfg

func (*Config) WithLabels

func (c *Config) WithLabels(lbls map[string][]string) *Config

WithLabels sets the environment label filters

func (*Config) WithNamespace

func (c *Config) WithNamespace(ns string) *Config

WithNamespace updates the environment namespace value

func (*Config) WithParallelTestEnabled added in v0.0.6

func (c *Config) WithParallelTestEnabled() *Config

WithParallelTestEnabled can be used to enable parallel run of the test features

func (*Config) WithRandomNamespace

func (c *Config) WithRandomNamespace() *Config

WithRandomNamespace sets the environment's namespace to a random value

func (*Config) WithSkipAssessmentRegex added in v0.0.4

func (c *Config) WithSkipAssessmentRegex(regex string) *Config

WithSkipAssessmentRegex sets the environment assessment regex filter

func (*Config) WithSkipFeatureRegex added in v0.0.4

func (c *Config) WithSkipFeatureRegex(regex string) *Config

WithSkipFeatureRegex sets the environment's skip feature regex filter

func (*Config) WithSkipLabels added in v0.0.4

func (c *Config) WithSkipLabels(lbls map[string][]string) *Config

WithSkipLabels sets the environment label filters

Jump to

Keyboard shortcuts

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