Documentation ¶
Index ¶
- type Suite
- func (s Suite) AddTest(t runtime.TestCase)
- func (s Suite) FindTests(pattern string) ([]runtime.TestCase, error)
- func (s Suite) GetGlobalConfig() runtime.GlobalTestConfig
- func (s Suite) GetNodeByName(name string) (runtime.Node, error)
- func (s Suite) GetNodes() []runtime.Node
- func (s Suite) GetTestByTitle(title string) (runtime.TestCase, error)
- func (s Suite) GetTests() []runtime.TestCase
- type YAMLNodeConf
- type YAMLSuiteConf
- type YAMLTest
- type YAMLTestConfigConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Suite ¶
type Suite struct { TestCases []runtime.TestCase Config runtime.GlobalTestConfig Nodes []runtime.Node }
Suite represents the current tests, nodes and configs. It is used by the runtime to execute all tests and is an abstraction for the given source. In example it could be possible to add more formats like XML or a custom DSL implementation.
func NewSuite ¶
NewSuite creates a suite structure from two byte slices, suiteContent is the file/suite that is under test overwriteConfigContent is an optional slice which overwrites the default configurations fileName is the file that is under test
func (Suite) AddTest ¶
AddTest pushes a new test to the suite if the test was already added it will panic
func (Suite) FindTests ¶
FindTests returns a test by the given pattern, if the test was not found an error is returned
func (Suite) GetGlobalConfig ¶
func (s Suite) GetGlobalConfig() runtime.GlobalTestConfig
GetGlobalConfig returns the global configuration which applies to the complete suite
func (Suite) GetNodeByName ¶
GetNodeByName returns a node by the given name
func (Suite) GetTestByTitle ¶
GetTestByTitle returns a test by title, if the test was not found an error is returned
type YAMLNodeConf ¶
type YAMLNodeConf struct { Name string `yaml:"-"` Type string `yaml:"type"` User string `yaml:"user,omitempty"` Pass string `yaml:"pass,omitempty"` Addr string `yaml:"addr,omitempty"` Image string `yaml:"image,omitempty"` IdentityFile string `yaml:"identity-file,omitempty"` Privileged bool `yaml:"privileged,omitempty"` DockerExecUser string `yaml:"docker-exec-user,omitempty"` }
type YAMLSuiteConf ¶
type YAMLSuiteConf struct { Tests map[string]YAMLTest `yaml:"tests"` Config YAMLTestConfigConf `yaml:"config,omitempty"` Nodes map[string]YAMLNodeConf `yaml:"nodes,omitempty"` }
YAMLSuiteConf will be used for unmarshalling the yaml test suite
func (YAMLSuiteConf) MarshalYAML ¶
func (y YAMLSuiteConf) MarshalYAML() (interface{}, error)
MarshalYAML adds custom logic to the struct to yaml conversion
func (*YAMLSuiteConf) UnmarshalYAML ¶
func (y *YAMLSuiteConf) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals the yaml
type YAMLTest ¶
type YAMLTest struct { Title string `yaml:"-"` Command string `yaml:"command,omitempty"` ExitCode int `yaml:"exit-code"` Stdout interface{} `yaml:"stdout,omitempty"` Stderr interface{} `yaml:"stderr,omitempty"` Config YAMLTestConfigConf `yaml:"config,omitempty"` Skip bool `yaml:"skip,omitempty"` }
YAMLTest represents a test in the yaml test suite
type YAMLTestConfigConf ¶
type YAMLTestConfigConf struct { InheritEnv bool `yaml:"inherit-env,omitempty"` Env map[string]string `yaml:"env,omitempty"` Dir string `yaml:"dir,omitempty"` Timeout string `yaml:"timeout,omitempty"` Retries int `yaml:"retries,omitempty"` Interval string `yaml:"interval,omitempty"` Nodes []string `yaml:"nodes,omitempty"` }
YAMLTestConfigConf is a struct to represent the test config