progress

package
v0.0.0-...-d195814 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-1.1, Apache-2.0, BSD-3-Clause, + 1 more Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat = "2006-01-02 15:04:05.000 -0700"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build map[string]Task

A Build represents the executions of tests reported by a set of progress files, grouped by progress file path.

type Class

type Class map[string]Method

A Class represents the executions of tests in a class, grouped by method description (method name and parameters).

type Cmd

type Cmd struct {
	FS       fs.FS
	Finder   finder
	Filter   filter
	Reporter reporter
}

func (Cmd) Run

func (c Cmd) Run(paths []string) error

type DurationFilter

type DurationFilter func(time.Duration) bool

func ParseDurationFilter

func ParseDurationFilter(c string) (DurationFilter, error)

type Execution

type Execution struct {
	Iteration int
	StartTime time.Time
	EndTime   time.Time
	Status    string
}

An Execution describes a single execution of a test. If a test is executed multiple times in a build, the Iteration distinguishes one execution from another. Note that progress assumes that each test result event corresponds to the earliest uncompleted start event for the same test description.

func (Execution) Duration

func (e Execution) Duration() time.Duration

Duration returns the duration of the test execution. If the execution has no recorded end event (as indicated by the "zero" end time), report its duration as 0.

type Filter

type Filter struct {
	ClassFilter      *regexp.Regexp
	MethodFilter     *regexp.Regexp
	StatusFilter     *regexp.Regexp
	StartTimeFilters []TimeFilter
	EndTimeFilters   []TimeFilter
	DurationFilters  []DurationFilter
}

Filter applies a set of criteria to each Execution in a Build.

func (Filter) Filter

func (f Filter) Filter(b Build) Build

Filter returns a Build with each Execution in b that satisfies all of f's criteria.

type Finder

type Finder struct {
	FS          fs.FS
	TaskMatcher *regexp.Regexp
}

func (Finder) Find

func (f Finder) Find(paths []string) ([]string, error)

type FormatReporter

type FormatReporter struct {
	Format *template.Template
	Out    io.Writer
}

FormatReporter writes each test in a Build, formatted according to a user-specified template.

func (FormatReporter) Report

func (r FormatReporter) Report(build Build) error

Report writes each test in the Build to the stream, formatted according to the template.

type JSONReporter

type JSONReporter struct {
	Out io.Writer
}

JSONReporter writes the JSON encoding of a Build to an output stream.

func (JSONReporter) Report

func (r JSONReporter) Report(b Build) error

Report writes the JSON encoding of b to the stream.

type Method

type Method []Execution

A Method represents the executions of a test method with a given set of parameters.

type Task

type Task map[string]Class

A Task represents the executions of tests reported by a single progress file, grouped by class name.

type TimeFilter

type TimeFilter func(time.Time) bool

func ParseTimeFilter

func ParseTimeFilter(c string) (TimeFilter, error)

Jump to

Keyboard shortcuts

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