lib

package
v0.0.0-...-9ec6d29 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Overview

Package lib provides utilities for runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTests

func RunTests(lang, image string, filter Filter, batchSize int, timeout time.Duration, proctorSettings ProctorSettings) int

RunTests is a helper that is called by main. It exists so that we can run defered functions before exiting. It returns an exit code that should be passed to os.Exit.

Types

type Filter

type Filter func(test string) bool

Filter is a predicate function for filtering tests. It returns true if the given test name should be run.

func ExcludeFilter

func ExcludeFilter(excludeFile string) (Filter, error)

ExcludeFilter reads the exclude file and returns a filter that excludes the tests listed in the given CSV file.

type ProctorSettings

type ProctorSettings struct {
	// PerTestTimeout is the timeout for each individual test.
	PerTestTimeout time.Duration
	// RunsPerTest is the number of times to run each test.
	// A value of 0 is the same as a value of 1, i.e. "run once".
	RunsPerTest int
	// If FlakyIsError is true, a flaky test will be considered as a failure.
	// If it is false, a flaky test will be considered as passing.
	FlakyIsError bool
	// If FlakyShortCircuit is true, when runnins with RunsPerTest > 1 and a test is detected as
	// flaky, exit immediately rather than running for all RunsPerTest attempts.
	FlakyShortCircuit bool
}

ProctorSettings contains settings passed directly to the proctor process.

func (ProctorSettings) ToArgs

func (p ProctorSettings) ToArgs() []string

ToArgs converts these settings to command-line arguments to pass to the proctor binary.

Jump to

Keyboard shortcuts

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