Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyDescription = fmt.Errorf("job description is empty") ErrNonNilError = fmt.Errorf("expected error to be non-nil") ErrNilError = fmt.Errorf("expected error to be nil") ErrMissingParameter = fmt.Errorf("missing parameter") ErrParameterAlreadySet = fmt.Errorf("parameter already set") ErrOrphanSteps = fmt.Errorf("background steps with no corresponding stop") ErrCannotStopStep = fmt.Errorf("cannot stop step") ErrMissingBackroundID = fmt.Errorf("missing background id") )
View Source
var DefaultOpts = StepOptions{ ExpectError: false, SkipSavingParamatersToJob: false, }
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Values *JobValues Description string Steps []*StepWrapper BackgroundSteps map[string]*StepWrapper }
A Job is a logical grouping of steps, options and values
func (*Job) AddScenario ¶
func (*Job) AddStep ¶
func (j *Job) AddStep(step Step, opts *StepOptions)
type Runner ¶
type Runner struct { Job *Job // contains filtered or unexported fields }
A wrapper around a job, so that internal job components don't require things like *testing.T and can be reused elsewhere
type Scenario ¶ added in v1.5.21
type Scenario struct {
Steps []*StepWrapper
}
A Scenario is a logical grouping of steps, used to describe a scenario such as "test drop metrics" which will require port forwarding, exec'ing, scraping, etc.
type Sleep ¶
func (*Sleep) Prevalidate ¶
type Step ¶
type Step interface { // Useful when wanting to do parameter checking, for example // if a parameter length is known to be required less than 80 characters, // do this here so we don't find out later on when we run the step // when possible, try to avoid making external calls, this should be fast and simple Prevalidate() error // Primary step where test logic is executed // Returning an error will cause the test to fail Run() error // Require for background steps Stop() error }
type StepOptions ¶
type StepOptions struct { ExpectError bool // Generally set this to false when you want to reuse // a step, but you don't want to save the parameters // ex: Sleep for 15 seconds, then Sleep for 10 seconds, // you don't want to save the parameters SkipSavingParamatersToJob bool // Will save this step to the job's steps // and then later on when Stop is called with job name, // it will call Stop() on the step RunInBackgroundWithID string }
type StepWrapper ¶
type StepWrapper struct { Step Step Opts *StepOptions }
A StepWrapper is a coupling of a step and it's options
Click to show internal directories.
Click to hide internal directories.