Documentation
¶
Overview ¶
Package parity replays the shared test cases the manager's Node export writes into testdata/parity, and compares Go results with the Node ones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSError ¶
AWSError is err as the AWS SDK returns a failed call: a recorded error becomes a *smithy.GenericAPIError (its code the name, its message the message), so the code under test reads it as it reads AWS's (awserr); any other error is returned as it is. The fakes of the AWS ports return AWSError(answers.Call(…)); Kubernetes ones keep their *kubernetes.Error.
Types ¶
type Answers ¶
type Answers struct {
// contains filtered or unexported fields
}
Answers answers port calls from the recorded answers of a case.
func Recorded ¶
func Recorded(t testing.TB, answers json.RawMessage) *Answers
Recorded reads a case's input.answers: {"<port>.<method>": [{"input", "output" or "error"}]}.
type Case ¶
type Case struct {
Name string `json:"name"`
Input json.RawMessage `json:"input"`
Output json.RawMessage `json:"output"`
}
Case is one shared case: an input and the output the Node code gave.
type RecordedError ¶
type RecordedError struct {
Name string `json:"name"`
Message string `json:"message"`
Status int `json:"status,omitempty"`
Reason string `json:"reason,omitempty"`
Code string `json:"code,omitempty"`
}
RecordedError is a failure the Node code saw from a port: the recorded "error" of an answer entry, {"name", "message", "status"?, "reason"?, "code"?}. Fakes return it as the port's error, so the Go code sees a failed call as the Node code did.