Documentation ¶
Index ¶
Constants ¶
View Source
const LogStepKey = "step"
Variables ¶
View Source
var Attempts = retry.Attempts
View Source
var BackOffDelay = retry.BackOffDelay
View Source
var Delay = retry.Delay
View Source
var DelayType = retry.DelayType
View Source
var FixedDelay = retry.FixedDelay
View Source
var OnRetry = retry.OnRetry
Functions ¶
Types ¶
type CleanupMode ¶
type CleanupMode string
CleanupMode says how runner should execute cleanup
const ( // CleanupModeNo - Don't execute cleanup CleanupModeNo CleanupMode = "no" // CleanupModeOnly - Don't run Steps, only cleanup CleanupModeOnly CleanupMode = "only" // Execute both Steps and cleanup CleanupModeYes CleanupMode = "yes" // Execute Steps. If Steps fail then run cleanup. Keep resources in case of success CleanupModeOnErrorOnly CleanupMode = "onErrorOnly" CleanupModeOnSuccessOnly CleanupMode = "onSuccessOnly" )
func (CleanupMode) String ¶
func (m CleanupMode) String() string
String implements pflag.Value.String
type Parallelized ¶
type Parallelized struct {
// contains filtered or unexported fields
}
func NewParallelRunner ¶
func NewParallelRunner(logf *logrus.Entry, name string, steps ...Step) *Parallelized
func (*Parallelized) Cleanup ¶
func (p *Parallelized) Cleanup() error
func (*Parallelized) Name ¶
func (p *Parallelized) Name() string
func (*Parallelized) OnError ¶
func (p *Parallelized) OnError() error
func (*Parallelized) Run ¶
func (p *Parallelized) Run() error
type Retried ¶
type Retried struct {
// contains filtered or unexported fields
}
func (*Retried) WithRetryOptions ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes Steps in safe manner
type RunnerOption ¶
type RunnerOption func(runner *Runner)
func WithCleanupDefault ¶
func WithCleanupDefault(mode CleanupMode) RunnerOption
func WithLogger ¶
func WithLogger(logger *logrus.Logger) RunnerOption
type SerialRunner ¶
type SerialRunner struct {
// contains filtered or unexported fields
}
func NewSerialTestRunner ¶
func NewSerialTestRunner(log *logrus.Entry, name string, steps ...Step) *SerialRunner
func (SerialRunner) Cleanup ¶
func (s SerialRunner) Cleanup() error
func (SerialRunner) Name ¶
func (s SerialRunner) Name() string
func (SerialRunner) OnError ¶
func (s SerialRunner) OnError() error
func (*SerialRunner) Run ¶
func (s *SerialRunner) Run() error
type Step ¶
type Step interface { // Name returns Name of the step Name() string // Run executes the step Run() error // Cleanup removes all resources that may possibly created by the step Cleanup() error // OnError is callback in case of error OnError() error }
Step represents a single action in test scenario
Source Files ¶
Click to show internal directories.
Click to hide internal directories.