testsuite

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCancelAllJobs

func GetCancelAllJobs(testSpec *api.TestSpec, apiConnectionDetails *client.ApiConnectionDetails) func(context.Context, chan *api.EventMessage, map[string]bool) error

GetCancelAllJobs returns a processor that cancels all jobs in jobIds one at a time and then consumes events until ctx is cancelled.

func TestSpecFromFilePath

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

func UnmarshalTestCase

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

UnmarshalTestCase unmarshals 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 behavior.
	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) Test

func (a *App) Test(ctx context.Context, testSpec *api.TestSpec, asserters ...func(context.Context, chan *api.EventMessage, map[string]bool) error) error

func (*App) TestFile

func (a *App) TestFile(ctx context.Context, filePath string) error

func (*App) TestFileJunit

func (a *App) TestFileJunit(ctx context.Context, filePath string) (junit.Testcase, 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.

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