Documentation
¶
Overview ¶
Package envconf stores configuration for a test environment
Index ¶
- func RandomName(prefix string, n int) string
- type Config
- func (c *Config) AssessmentRegex() *regexp.Regexp
- func (c *Config) Client() klient.Client
- func (c *Config) DisableGracefulTeardown() bool
- func (c *Config) DryRunMode() bool
- func (c *Config) FailFast() bool
- func (c *Config) FeatureRegex() *regexp.Regexp
- func (c *Config) GetClient() klient.Client
- func (c *Config) KubeContext() string
- func (c *Config) KubeconfigFile() string
- func (c *Config) Labels() map[string][]string
- func (c *Config) Namespace() string
- func (c *Config) NewClient() (klient.Client, error)
- func (c *Config) ParallelTestEnabled() bool
- func (c *Config) SkipAssessmentRegex() *regexp.Regexp
- func (c *Config) SkipFeatureRegex() *regexp.Regexp
- func (c *Config) SkipLabels() map[string][]string
- func (c *Config) WithAssessmentRegex(regex string) *Config
- func (c *Config) WithClient(client klient.Client) *Config
- func (c *Config) WithDisableGracefulTeardown() *Config
- func (c *Config) WithDryRunMode() *Config
- func (c *Config) WithFailFast() *Config
- func (c *Config) WithFeatureRegex(regex string) *Config
- func (c *Config) WithKubeContext(kubeContext string) *Config
- func (c *Config) WithKubeconfigFile(kubecfg string) *Config
- func (c *Config) WithLabels(lbls map[string][]string) *Config
- func (c *Config) WithNamespace(ns string) *Config
- func (c *Config) WithParallelTestEnabled() *Config
- func (c *Config) WithRandomNamespace() *Config
- func (c *Config) WithSkipAssessmentRegex(regex string) *Config
- func (c *Config) WithSkipFeatureRegex(regex string) *Config
- func (c *Config) WithSkipLabels(lbls map[string][]string) *Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomName ¶
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 NewFromFlags ¶
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
NewWithKubeConfig creates and initializes an empty environment configuration
func (*Config) AssessmentRegex ¶
AssessmentRegex returns the environment assessment filter
func (*Config) 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
DisableGracefulTeardown is used to check the panic recovery handler should be enabled
func (*Config) DryRunMode ¶ added in v0.0.7
func (*Config) FailFast ¶ added in v0.0.7
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 ¶
FeatureRegex returns the environment's feature regex filter
func (*Config) KubeContext ¶ added in v0.2.0
KubeContext is used to get the kubeconfig context
func (*Config) KubeconfigFile ¶ added in v0.0.4
func (*Config) NewClient ¶ added in v0.0.4
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
ParallelTestEnabled indicates if the test features are being run in parallel or not
func (*Config) SkipAssessmentRegex ¶ added in v0.0.4
SkipAssessmentRegex returns the environment assessment filter
func (*Config) SkipFeatureRegex ¶ added in v0.0.4
SkipFeatureRegex returns the environment's skipfeature regex filter
func (*Config) SkipLabels ¶ added in v0.0.4
SkipLabels returns the environment's label filters
func (*Config) WithAssessmentRegex ¶
WithAssessmentRegex sets the environment assessment regex filter
func (*Config) WithClient ¶
WithClient used to update the environment klient.Client
func (*Config) WithDisableGracefulTeardown ¶ added in v0.0.8
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 (*Config) WithFailFast ¶ added in v0.0.7
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 ¶
WithFeatureRegex sets the environment's feature regex filter
func (*Config) WithKubeContext ¶ added in v0.2.0
WithKubeContext is used to set the kubeconfig context
func (*Config) WithKubeconfigFile ¶ added in v0.0.3
WithKubeconfigFile creates a new klient.Client and injects it in the cfg
func (*Config) WithLabels ¶
WithLabels sets the environment label filters
func (*Config) WithNamespace ¶
WithNamespace updates the environment namespace value
func (*Config) WithParallelTestEnabled ¶ added in v0.0.6
WithParallelTestEnabled can be used to enable parallel run of the test features
func (*Config) WithRandomNamespace ¶
WithRandomNamespace sets the environment's namespace to a random value
func (*Config) WithSkipAssessmentRegex ¶ added in v0.0.4
WithSkipAssessmentRegex sets the environment assessment regex filter
func (*Config) WithSkipFeatureRegex ¶ added in v0.0.4
WithSkipFeatureRegex sets the environment's skip feature regex filter