Documentation ¶
Overview ¶
Package parser is the package responsible for parsing test cases and istio configuration to be use on test assertionpackage parser
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyAuthorityList indicates an empty Authority list ErrEmptyAuthorityList = errors.New("authority list is empty") // ErrEmptyMethodList indicates an empty Method list ErrEmptyMethodList = errors.New("method list is empty") // ErrEmptyURIList indicates an empty URI list ErrEmptyURIList = errors.New("URI list is empty") )
Functions ¶
This section is empty.
Types ¶
type Destination ¶
Destination define the destination we should assert
type Parser ¶
type Parser struct { TestCases []*TestCase VirtualServices []*v1alpha3.VirtualService }
Parser contains the parsed files needed to run tests
type Port ¶
type Port struct {
Number int16 `yaml:"number"`
}
Port define the port of a given Destination
type Request ¶
type Request struct { Authority []string `yaml:"authority"` Method []string `yaml:"method"` URI []string `yaml:"uri"` Headers map[string]string `yaml:"headers"` }
Request define the crafted http request present in the test case file.
func (*Request) Unfold ¶
Unfold returns a list of Input objects constructed by all possibilities defined in the Request object. Ex: Request{Authority: {"www.example.com", "example.com"}, Method: {"GET", "OPTIONS"}}
returns []Input{ {Authority:"www.example.com", Method: "GET"}, {Authority:"www.example.com", Method: "OPTIONS"} {Authority:"example.com", Method: "GET"}, {Authority:"example.com", Method: "OPTIONS"}, }
type TestCase ¶
type TestCase struct { Description string `yaml:"description"` Request *Request `yaml:"request"` Route []*networkingv1alpha3.HTTPRouteDestination `yaml:"route"` Redirect *networkingv1alpha3.HTTPRedirect `yaml:"redirect"` Rewrite *networkingv1alpha3.HTTPRewrite `yaml:"rewrite"` Fault *networkingv1alpha3.HTTPFaultInjection `yaml:"fault"` Headers *networkingv1alpha3.Headers `yaml:"headers"` WantMatch bool `yaml:"wantMatch"` }
TestCase defines the API for declaring unit tests
type TestCaseYAML ¶
type TestCaseYAML struct {
TestCases []*TestCase `yaml:"testCases"`
}
TestCaseYAML define the list of TestCase
Click to show internal directories.
Click to hide internal directories.