testsuite

package
v0.3.45 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestSpecFromFilePath

func TestSpecFromFilePath(filePath string) (*api.TestSpec, error)

func TestSpecsFromFilePaths added in v0.3.44

func TestSpecsFromFilePaths(filePaths []string) ([]*api.TestSpec, error)

func TestSpecsFromPattern added in v0.3.44

func TestSpecsFromPattern(pattern string) ([]*api.TestSpec, error)

func UnmarshalTestCase

func UnmarshalTestCase(yamlBytes []byte, testSpec *api.TestSpec) error

UnmarshalTestCase unmarshalls bytes into a TestSpec.

Types

type App

type App struct {
	// Parameters passed to the CLI by the user.
	Params *Params
	// Out is used to write the output. Defaults to standard out,
	// but can be overridden in tests to make assertions on the applications's output.
	Out io.Writer
	// Source of randomness. Tests can use a mocked random source in order to provide
	// deterministic testing behaviour.
	Random io.Reader
}

func New

func New() *App

New instantiates an App with default parameters, including standard output and cryptographically secure random source.

func (*App) RunTests added in v0.3.44

func (a *App) RunTests(ctx context.Context, testSpecs []*api.TestSpec) (*TestSuiteReport, error)

func (*App) TestPattern added in v0.3.44

func (a *App) TestPattern(ctx context.Context, pattern string) (*TestSuiteReport, error)

func (*App) Version

func (a *App) Version() error

Version prints build information (e.g., current git commit) to the app output.

type Params

type Params struct {
	ApiConnectionDetails *client.ApiConnectionDetails
}

Params struct holds all user-customizable parameters. Using a single struct for all CLI commands ensures that all flags are distinct and that they can be provided either dynamically on a command line, or statically in a config file that's reused between command runs.

type TestCaseReport added in v0.3.44

type TestCaseReport struct {
	Out             *bytes.Buffer
	Start           time.Time
	Finish          time.Time
	FailureReason   string
	BenchmarkReport *eventbenchmark.TestCaseBenchmarkReport
	TestSpec        *api.TestSpec
}

func (*TestCaseReport) JunitTestCase added in v0.3.44

func (report *TestCaseReport) JunitTestCase() junit.Testcase

Convert to Junit TestCase according to spec: https://llg.cubic.org/docs/junit/

type TestRunner added in v0.3.44

type TestRunner struct {
	Out io.Writer

	TestCaseReport *TestCaseReport
	// contains filtered or unexported fields
}

func (*TestRunner) Run added in v0.3.44

func (srv *TestRunner) Run(ctx context.Context) (err error)

type TestSuiteReport added in v0.3.44

type TestSuiteReport struct {
	Start           time.Time
	Finish          time.Time
	TestCaseReports []*TestCaseReport
}

func (*TestSuiteReport) NumFailures added in v0.3.44

func (report *TestSuiteReport) NumFailures() int

func (*TestSuiteReport) NumSuccesses added in v0.3.44

func (report *TestSuiteReport) NumSuccesses() int

Directories

Path Synopsis
Package build info
Package build info
Utility for watching events.
Utility for watching events.

Jump to

Keyboard shortcuts

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