suite

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Suite

type Suite interface {
	GetTests() []runtime.TestCase
	GetTestByTitle(title string) (runtime.TestCase, error)
	GetGlobalConfig() runtime.TestConfig
}

Suite represents the current tests and configs

func ParseYAML

func ParseYAML(content []byte) Suite

ParseYAML parses the Suite from a yaml byte slice

type YAMLConfig

type YAMLConfig struct {
	Tests  map[string]YAMLTest `yaml:"tests"`
	Config YAMLTestConfig      `yaml:"config,omitempty"`
}

YAMLConfig will be used for unmarshalling the yaml test suite

func (YAMLConfig) MarshalYAML added in v1.2.1

func (y YAMLConfig) MarshalYAML() (interface{}, error)

MarshalYAML adds custom logic to the struct to yaml conversion

func (*YAMLConfig) UnmarshalYAML

func (y *YAMLConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals the yaml

type YAMLSuite

type YAMLSuite struct {
	TestCases []runtime.TestCase
	Config    runtime.TestConfig
}

YAMLSuite represents a test suite which was configured in yaml

func (YAMLSuite) GetGlobalConfig

func (s YAMLSuite) GetGlobalConfig() runtime.TestConfig

GetGlobalConfig returns the global suite configuration

func (YAMLSuite) GetTestByTitle

func (s YAMLSuite) GetTestByTitle(title string) (runtime.TestCase, error)

GetTestByTitle returns the first test it finds for the given title

func (YAMLSuite) GetTests

func (s YAMLSuite) GetTests() []runtime.TestCase

GetTests returns all tests of the test suite

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   YAMLTestConfig `yaml:"config,omitempty"`
}

YAMLTest represents a test in the yaml test suite

type YAMLTestConfig

type YAMLTestConfig 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"`
}

YAMLTestConfig is a struct to represent the test config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL