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 ¶
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 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) GetClient ¶ added in v0.5.0
func (c *Config) GetClient() klient.Client
GetClient returns the client for the environment
func (*Config) KubeContext ¶ added in v0.2.0
func (c *Config) KubeContext() string
KubeContext 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