results

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average(slice []time.Duration) time.Duration

Average returns the average test duration (median)

func Deviation

func Deviation(slice []time.Duration) time.Duration

Deviation returns the standard deviation of duration

func Duration

func Duration(runs []Run) time.Duration

Duration returns the time spent between the first and the last test run.

func Durations

func Durations(runs []Run) []time.Duration

Duration returns a slice of test run durations

func Loads

func Loads(runs []Run) []float64

Loads returns a slice of test run durations

func Mean

func Mean(slice []time.Duration) time.Duration

Mean returns arithmetic mean

func Total

func Total(runs []Run) time.Duration

Total returns total time spent if all runs would have been executed sequentially.

Types

type DB

type DB struct {
	Version int
	MaxJobs int
	MaxLoad int
	Runs    []Run
}

A DB struct contains results of last test executable execution

type Run

type Run struct {
	Name     string // Full qualified test name
	Instance int    // Test instance
	Verdict  string // the test verdict (pass, fail, none, ...)
	Reason   string // Optional reason for verdicts

	Begin Timestamp // When the test was started
	End   Timestamp // When the test ended

	WorkingDir string  // Working Directory of the test
	Load       float64 // the system load when the test was started
	MaxMem     int     // the maximum memory used when the test ended

	RunnerID string `json:"runnerid"`
}

A Run describes the execution of a single test case.

func FinalVerdicts

func FinalVerdicts(runs []Run) []Run

FinalVerdicts folds multiple runs instances into one with a final verdict.

* A test is considered "pass", if all runs had verdict "pass". * A test is considered "unstable", if only some runs had verdict "pass" * Runs with worse or equal verdict will overwrite previous runs.

func First

func First(runs []Run) Run

First returns the first test run

func Last

func Last(runs []Run) Run

Last returns the last test run

func Longest

func Longest(runs []Run) Run

Longest returns the longest test run

func Shortest

func Shortest(runs []Run) Run

Shortest returns the shortest test run

func (Run) Duration

func (r Run) Duration() time.Duration

Duration of an individual run

func (Run) ID

func (r Run) ID() string

A unique identifier of the run. Usually something like "testname-2"

func (Run) String

func (r Run) String() string

String returns a printable and simplified representation of Run

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp is a Unix timestamp in milliseconds.

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON is used to convert the timestamp to JSON

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(s []byte) (err error)

UnmarshalJSON is used to convert the timestamp from JSON

Jump to

Keyboard shortcuts

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