Documentation ¶
Index ¶
- func TestCommand(setup TestSetupFunc) *cobra.Command
- func WithFeatureFlags(ctx context.Context, features string) (context.Context, error)
- type IntHeap
- type Test
- type TestExecutor
- type TestFlags
- type TestReporter
- type TestResultFunc
- type TestRunner
- func (t *TestRunner) Finish() bool
- func (t *TestRunner) Gather(roots []string) error
- func (t *TestRunner) MarkSkipped(testNames, skips, tags []string, skipUntagged bool)
- func (t *TestRunner) Run(executor TestExecutor, verbosity int)
- func (t *TestRunner) RunParallel(executor TestExecutor, verbosity int)
- type TestSetupFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestCommand ¶ added in v0.101.0
func TestCommand(setup TestSetupFunc) *cobra.Command
Types ¶
type Test ¶ added in v0.99.0
type Test struct {
// contains filtered or unexported fields
}
Test wraps the functionality of a single testcase statement, to handle its execution and its skip/pass/fail state.
func (*Test) PackageName ¶ added in v0.179.0
func (*Test) Run ¶ added in v0.99.0
func (t *Test) Run(executor TestExecutor)
Run the test, saving the error to the err property of the struct.
func (*Test) SourceCode ¶ added in v0.156.0
type TestExecutor ¶ added in v0.101.0
type TestFlags ¶ added in v0.162.0
type TestFlags struct {
// contains filtered or unexported fields
}
type TestReporter ¶ added in v0.99.0
type TestReporter struct {
// contains filtered or unexported fields
}
TestReporter handles reporting of test results.
func (*TestReporter) ReportTestRun ¶ added in v0.99.0
func (t *TestReporter) ReportTestRun(test *Test)
ReportTestRun reports the result a single test run, intended to be run as each test is run.
func (*TestReporter) Summarize ¶ added in v0.99.0
func (t *TestReporter) Summarize(tests []*Test) bool
Summarize summarizes the test run.
type TestResultFunc ¶ added in v0.172.0
type TestResultFunc func(ctx context.Context, results flux.ResultIterator) error
TestResultFunc is a function that processes the result of running a test file. This function must be invoked from the implementation of TestExecutor.
type TestRunner ¶ added in v0.99.0
type TestRunner struct {
// contains filtered or unexported fields
}
TestRunner gathers and runs all tests.
func NewTestRunner ¶ added in v0.99.0
func NewTestRunner(reporter TestReporter) TestRunner
NewTestRunner returns a new TestRunner.
func (*TestRunner) Finish ¶ added in v0.99.0
func (t *TestRunner) Finish() bool
Finish summarizes the test run, and returns an error in the event of a failure.
func (*TestRunner) Gather ¶ added in v0.99.0
func (t *TestRunner) Gather(roots []string) error
Gather gathers all tests from the filesystem and creates Test instances from that info.
func (*TestRunner) MarkSkipped ¶ added in v0.174.0
func (t *TestRunner) MarkSkipped(testNames, skips, tags []string, skipUntagged bool)
MarkSkipped checks the provided filters and marks each test case as skipped as needed.
Skip rules:
- When testNames is not empty any test in the list will be run, all others skipped.
- When a test name is in skips, the test is skipped.
- When a test contains any tags all tags must be specified for the test to run.
- When skipUntagged is true, any test that does not have any tags is skipped.
The list of tests takes precedence over all other parameters.
func (*TestRunner) Run ¶ added in v0.99.0
func (t *TestRunner) Run(executor TestExecutor, verbosity int)
func (*TestRunner) RunParallel ¶ added in v0.172.0
func (t *TestRunner) RunParallel(executor TestExecutor, verbosity int)
Run runs all tests, reporting their results.
type TestSetupFunc ¶ added in v0.101.0
type TestSetupFunc func(ctx context.Context) (TestExecutor, error)