Documentation ¶
Index ¶
- Variables
- func ExpectedIntAt(node *yaml.Node) error
- func ExpectedMapAt(node *yaml.Node) error
- func ExpectedRetryAt(node *yaml.Node) error
- func ExpectedScalarAt(node *yaml.Node) error
- func ExpectedScalarOrMapAt(node *yaml.Node) error
- func ExpectedScalarOrSequenceAt(node *yaml.Node) error
- func ExpectedSequenceAt(node *yaml.Node) error
- func ExpectedTimeoutAt(node *yaml.Node) error
- func ExpectedWaitAt(node *yaml.Node) error
- func FileNotFound(path string, node *yaml.Node) error
- func In(element, container interface{}) error
- func InvalidRetryAttempts(node *yaml.Node, attempts int) error
- func NoneIn(elements, container interface{}) error
- func NotEqual(exp, got interface{}) error
- func NotEqualLength(exp, got int) error
- func NotIn(element, container interface{}) error
- func RequiredFixtureMissing(name string) error
- func TimeoutExceeded(duration string, failure error) error
- func UnexpectedError(err error) error
- func UnknownFieldAt(field string, node *yaml.Node) error
- func UnknownSourceType(source interface{}) error
- func UnknownSpecAt(path string, node *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFailure is the base error class for all errors that represent failed // assertions when evaluating a test. ErrFailure = errors.New("assertion failed") // ErrTimeoutExceeded is an ErrFailure when a test's execution exceeds a // timeout length. ErrTimeoutExceeded = fmt.Errorf("%s: timeout exceeded", ErrFailure) // ErrNotEqual is an ErrFailure when an expected thing doesn't equal an // observed thing. ErrNotEqual = fmt.Errorf("%w: not equal", ErrFailure) // ErrIn is an ErrFailure when a thing unexpectedly appears in an // container. ErrIn = fmt.Errorf("%w: in", ErrFailure) // ErrNotIn is an ErrFailure when an expected thing doesn't appear in an // expected container. ErrNotIn = fmt.Errorf("%w: not in", ErrFailure) // ErrNoneIn is an ErrFailure when none of a list of elements appears in an // expected container. ErrNoneIn = fmt.Errorf("%w: none in", ErrFailure) // ErrUnexpectedError is an ErrFailure when an unexpected error has // occurred. ErrUnexpectedError = fmt.Errorf("%w: unexpected error", ErrFailure) )
var ( // ErrUnknownSourceType indicates that a From() function was called with an // unknown source parameter type. ErrUnknownSourceType = errors.New("unknown source argument type") // ErrUnknownSpec indicates that there was a test spec definition in a YAML // file that no plugin could parse. ErrUnknownSpec = errors.New("no plugin could parse spec definition") // ErrUnknownField indicates that there was an unknown field in the parsing // of a spec or scenario. ErrUnknownField = errors.New("unknown field") // ErrParse indicates a YAML definition is not valid ErrParse = errors.New("invalid YAML") // ErrExpectedMap indicates that we did not find an expected mapping // field ErrExpectedMap = fmt.Errorf( "%w: expected map field", ErrParse, ) // ErrExpectedScalar indicates that we did not find an expected scalar // field ErrExpectedScalar = fmt.Errorf( "%w: expected scalar field", ErrParse, ) // ErrExpectedSequence indicates that we did not find an expected // scalar field ErrExpectedSequence = fmt.Errorf( "%w: expected sequence field", ErrParse, ) // ErrExpectedInt indicates that we did not find an expected integer // value ErrExpectedInt = fmt.Errorf( "%w: expected int value", ErrParse, ) // ErrExpectedScalarOrMap indicates that we did not find an expected // scalar or map field ErrExpectedScalarOrMap = fmt.Errorf( "%w: expected scalar or map field", ErrParse, ) // ErrExpectedScalarOrSequence indicates that we did not find an expected // scalar or sequence of scalars field ErrExpectedScalarOrSequence = fmt.Errorf( "%w: expected scalar or sequence of scalars field", ErrParse, ) // ErrExpectedTimeout indicates that the timeout specification was not // valid. ErrExpectedTimeout = fmt.Errorf( "%w: expected timeout specification", ErrParse, ) // ErrExpectedWait indicates that the wait specification was not valid. ErrExpectedWait = fmt.Errorf( "%w: expected wait specification", ErrParse, ) // ErrExpectedRetry indicates that the retry specification was not valid. ErrExpectedRetry = fmt.Errorf( "%w: expected retry specification", ErrParse, ) // ErrInvalidRetryAttempts indicates that the retry attempts was not // positive. ErrInvalidRetryAttempts = fmt.Errorf( "%w: invalid retry attempts", ErrParse, ) // ErrFileNotFound is returned when a file path does not exist for a // create/apply/delete target. ErrFileNotFound = fmt.Errorf( "%w: file not found", ErrParse, ) )
var ( // RuntimeError is the base error class for all errors occurring during // runtime (and not during the parsing of a scenario or spec) RuntimeError = errors.New("runtime error") // ErrRequiredFixture is returned when a required fixture has not // been registered with the context. ErrRequiredFixture = fmt.Errorf( "%w: required fixture missing", RuntimeError, ) )
Functions ¶
func ExpectedIntAt ¶
func ExpectedIntAt(node *yaml.Node) error
ExpectedIntAt returns an ErrExpectedInt error annotated with the line/column of the supplied YAML node.
func ExpectedMapAt ¶
func ExpectedMapAt(node *yaml.Node) error
ExpectedMapAt returns an ErrExpectedMap error annotated with the line/column of the supplied YAML node.
func ExpectedRetryAt ¶ added in v1.7.0
func ExpectedRetryAt(node *yaml.Node) error
ExpectedRetryAt returns an ErrExpectedRetry error annotated with the line/column of the supplied YAML node.
func ExpectedScalarAt ¶
func ExpectedScalarAt(node *yaml.Node) error
ExpectedScalarAt returns an ErrExpectedScalar error annotated with the line/column of the supplied YAML node.
func ExpectedScalarOrMapAt ¶ added in v1.2.1
func ExpectedScalarOrMapAt(node *yaml.Node) error
ExpectedScalarOrMapAt returns an ErrExpectedScalarOrMap error annotated with the line/column of the supplied YAML node.
func ExpectedScalarOrSequenceAt ¶
func ExpectedScalarOrSequenceAt(node *yaml.Node) error
ExpectedScalarOrSequenceAt returns an ErrExpectedScalarOrSequence error annotated with the line/column of the supplied YAML node.
func ExpectedSequenceAt ¶
func ExpectedSequenceAt(node *yaml.Node) error
ExpectedSequenceAt returns an ErrExpectedSequence error annotated with the line/column of the supplied YAML node.
func ExpectedTimeoutAt ¶
func ExpectedTimeoutAt(node *yaml.Node) error
ExpectedTimeoutAt returns an ErrExpectedTimeout error annotated with the line/column of the supplied YAML node.
func ExpectedWaitAt ¶
func ExpectedWaitAt(node *yaml.Node) error
ExpectedWaitAt returns an ErrExpectedWait error annotated with the line/column of the supplied YAML node.
func FileNotFound ¶
FileNotFound returns ErrFileNotFound for a given file path
func In ¶ added in v1.3.0
func In(element, container interface{}) error
In returns an ErrIn when a thing unexpectedly appears in a container.
func InvalidRetryAttempts ¶ added in v1.7.0
InvalidRetryAttempts returns an ErrInvalidRetryAttempts error annotated with the line/column of the supplied YAML node.
func NoneIn ¶
func NoneIn(elements, container interface{}) error
NoneIn returns an ErrNoneIn when none of a list of elements appears in an expected container.
func NotEqual ¶
func NotEqual(exp, got interface{}) error
NotEqual returns an ErrNotEqual when an expected thing doesn't equal an observed thing.
func NotEqualLength ¶
NotEqualLength returns an ErrNotEqual when an expected length doesn't equal an observed length.
func NotIn ¶
func NotIn(element, container interface{}) error
NotIn returns an ErrNotIn when an expected thing doesn't appear in an expected container.
func RequiredFixtureMissing ¶
RequiredFixtureMissing returns an ErrRequiredFixture with the supplied fixture name
func TimeoutExceeded ¶
TimeoutExceeded returns an ErrTimeoutExceeded when a test's execution exceeds a timeout length. The optional failure parameter indicates a failed assertion that occurred before a timeout was reached.
func UnexpectedError ¶
UnexpectedError returns an ErrUnexpectedError when a supplied error is not expected.
func UnknownFieldAt ¶
UnknownFieldAt returns an ErrUnknownField for a supplied field annotated with the line/column of the supplied YAML node.
func UnknownSourceType ¶
func UnknownSourceType(source interface{}) error
UnknownSourceType returns an ErrUnknownSourceType error describing the supplied parameter type.
func UnknownSpecAt ¶
UnknownSpecAt returns an ErrUnknownSpec with the line/column of the supplied YAML node.
Types ¶
This section is empty.