Documentation ¶
Index ¶
Constants ¶
const ( StartedEvent = event.Name("ExampleStartedEvent") FinishedEvent = event.Name("ExampleFinishedEvent") FailedEvent = event.Name("ExampleFailedEvent") )
events that we may emit during the plugin's lifecycle. This is used in Events below. Note that you don't normally need to emit start/finish/cancellation events as these are emitted automatically by the framework.
const (
// Fail this percentage of targets at random.
FailPctParam = "FailPct"
)
Params this step accepts.
Variables ¶
var Events = []event.Name{StartedEvent, FinishedEvent, FailedEvent}
Events defines the events that a TestStep is allow to emit. Emitting an event that is not registered here will cause the plugin to terminate with an error.
var Name = "Example"
Name is the name used to look this plugin up.
Functions ¶
Types ¶
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
Step is an example implementation of a TestStep which simply consumes Targets in input and pipes them to the output or error channel with intermediate buffering.
func (*Step) Run ¶
func (ts *Step) Run(ctx xcontext.Context, ch test.TestStepChannels, params test.TestStepParameters, ev testevent.Emitter, resumeState json.RawMessage) (json.RawMessage, error)
Run executes the example step.
func (*Step) ValidateParameters ¶
ValidateParameters validates the parameters associated to the TestStep