Documentation ¶
Index ¶
- func Case(name string, fn func())
- func Configure(cfg Configuration) error
- func Default(fn func())
- func ErrorCase(name string, fn func())
- func FatalErr(format string, args ...interface{}) error
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Run(ctx context.Context, runErrorCases bool, exclude []string) bool
- func SetLogLevel(level LogLevel)
- func Validate(ctx context.Context, cctx *cli.Context, exclude []string) []error
- type Configuration
- type FeatureFunc
- type FeatureImpl
- func (f *FeatureImpl) NeedsFlag(flag string) bool
- func (f *FeatureImpl) RequiredFlags(flags ...string) interface{}
- func (f *FeatureImpl) RunsBefore(label string) interface{}
- func (f *FeatureImpl) RunsInside(label string) interface{}
- func (f *FeatureImpl) TearDown(name string, fn FeatureFunc) interface{}
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Case ¶ added in v0.15.0
func Case(name string, fn func())
Case represents a test case of a feature.
func Configure ¶
func Configure(cfg Configuration) error
Configure configures all the values needed to run the acceptance tests. This should be called before run.
func ErrorCase ¶
func ErrorCase(name string, fn func())
ErrorCase represents an error case for a feature. These are optionally tested based on command line flags.
Failure of an error case does not prevent further error cases or RunsInside features from running.
func Infof ¶
func Infof(format string, args ...interface{})
Infof prints the given format string and args at the appropriate indentation level, if the logger is at info level or above.
func Infoln ¶
func Infoln(args ...interface{})
Infoln prints the given args at the appropriate indentation level, if the logger is at info level or above.
func Run ¶
Run runs the acceptance tests for all features, less the ones with labels in exclude.
run returns a bool indicating success or failure
func SetLogLevel ¶
func SetLogLevel(level LogLevel)
SetLogLevel configures the log level for the duration of an acceptance test run.
Types ¶
type Configuration ¶ added in v0.13.0
type Configuration struct { API *grafton.Client Product string Region string Plan string PlanFeatures manifold.FeatureMap NewPlan string NewPlanFeatures manifold.FeatureMap ClientID string ClientSecret string Port uint CallbackTimeout string ResourceMeasures string Credential string }
Configuration defines the config options for the acceptance tests
type FeatureFunc ¶
FeatureFunc is the func type run to test features
type FeatureImpl ¶
type FeatureImpl struct {
// contains filtered or unexported fields
}
FeatureImpl is a feature implementation.
func Feature ¶
func Feature(label, name string, fn FeatureFunc) *FeatureImpl
Feature represents a testable feature
func (*FeatureImpl) NeedsFlag ¶
func (f *FeatureImpl) NeedsFlag(flag string) bool
NeedsFlag checks if a Feature Implementation needs a specific flag or not.
func (*FeatureImpl) RequiredFlags ¶
func (f *FeatureImpl) RequiredFlags(flags ...string) interface{}
RequiredFlags marks a set of flags required for a feature. We will use this to see that all flags are provided when executing a test.
func (*FeatureImpl) RunsBefore ¶
func (f *FeatureImpl) RunsBefore(label string) interface{}
RunsBefore expresses a dependency between two features. A feature that runs before another feature will execute its tests, and tear down before the other is run.
func (*FeatureImpl) RunsInside ¶
func (f *FeatureImpl) RunsInside(label string) interface{}
RunsInside expresses a dependency between two features. A feature that runs inside another feature will execute its tests, and tear down after the other is run, but before it is torn down.
func (*FeatureImpl) TearDown ¶
func (f *FeatureImpl) TearDown(name string, fn FeatureFunc) interface{}
TearDown represents the optional teardown step for a feature