runner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunStage

func RunStage(runContext *TestRunContext, ftwCheck *check.FTWCheck, testCase test.Test, stage test.Stage)

RunStage runs an individual test stage. runContext contains information for the current test run ftwCheck is the current check utility testCase is the test case the stage belongs to stage is the stage you want to run

func RunTest

func RunTest(runContext *TestRunContext, ftwTest test.FTWTest)

RunTest runs an individual test. runContext contains information for the current test run ftwTest is the test you want to run

Types

type Config

type Config struct {
	// Include is a regular expression to filter tests to include. If nil, all tests are included.
	Include *regexp.Regexp
	// Exclude is a regular expression to filter tests to exclude. If nil, no tests are excluded.
	Exclude *regexp.Regexp
	// ShowTime determines whether to show the time taken to run each test.
	ShowTime bool
	// Quiet determines whether to output informational messages.
	Quiet bool
	// ConnectTimeout is the timeout for connecting to endpoints during test execution.
	ConnectTimeout time.Duration
	// ReadTimeout is the timeout for receiving responses during test execution.
	ReadTimeout time.Duration
}

Config provides configuration for the test runner.

type TestResult

type TestResult int

TestResult type are the values that the result of a test can have

const (
	Success TestResult = iota
	Failed
	Skipped
	Ignored
	ForcePass
	ForceFail
)

Handy constants for test results

type TestRunContext

type TestRunContext struct {
	Include  *regexp.Regexp
	Exclude  *regexp.Regexp
	ShowTime bool
	Output   bool
	Stats    TestStats
	Result   TestResult
	Duration time.Duration
	Client   *ftwhttp.Client
	LogLines *waflog.FTWLogLines
	RunMode  config.RunMode
}

TestRunContext carries information about the current test run. This includes both configuration information as well as statistics and results.

func Run

func Run(tests []test.FTWTest, c Config) TestRunContext

Run runs your tests with the specified Config. Returns error if some test failed

type TestStats

type TestStats struct {
	Run        int
	Failed     []string
	Skipped    []string
	Ignored    []string
	ForcedPass []string
	ForcedFail []string
	Success    int
	RunTime    time.Duration
}

TestStats accumulates test statistics

func (*TestStats) TotalFailed

func (t *TestStats) TotalFailed() int

Jump to

Keyboard shortcuts

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