Documentation
¶
Index ¶
Constants ¶
const ( ExitCode = "ExitCode" Stdout = "Stdout" Stderr = "Stderr" LineCount = "LineCount" )
Constants for defining the various tested properties
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start(tests []TestCase, maxConcurrent int) <-chan TestResult
Start starts the given test suite
Types ¶
type CommandResult ¶
type CommandResult struct {
Status ResultStatus
Stdout string
Stderr string
ExitCode int
FailureProperties []string
Error error
}
CommandResult holds the result for a specific test
type CommandUnderTest ¶
type CommandUnderTest struct {
Cmd string
Env map[string]string
Dir string
Timeout string
Retries int
}
CommandUnderTest represents the command under test
func (*CommandUnderTest) GetRetries ¶ added in v1.0.0
func (c *CommandUnderTest) GetRetries() int
type Expected ¶
type Expected struct {
Stdout ExpectedOut
Stderr ExpectedOut
LineCount int
ExitCode int
}
Expected is the expected output of the command under test
type ExpectedOut ¶
ExpectedOut represents the assertions on stdout and stderr
type ResultStatus ¶
type ResultStatus int
ResultStatus represents the status code of a test result
const ( //Success status Success ResultStatus = iota // Failed status Failed // Skipped status Skipped )
Result status codes
type TestCase ¶
type TestCase struct {
Title string
Command CommandUnderTest
Expected Expected
Result CommandResult
}
TestCase represents a test case which will be executed by the runtime
type TestConfig ¶
TestConfig represents the configuration for a test
type TestResult ¶
type TestResult struct {
TestCase TestCase
ValidationResult ValidationResult
FailedProperty string
Tries int
}
TestResult represents the TestCase and the ValidationResult
func Validate ¶
func Validate(test TestCase) TestResult
Validate validates the test results with the expected values
type ValidationResult ¶
ValidationResult will be returned after the validation was executed