flakesync

package
v0.0.0-...-5853c50 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResultStable means green, everything passed
	ResultStable ResultStatus = "stable"

	// ResultFlaky means the job run worked, but some tests failed.
	ResultFlaky ResultStatus = "flaky"

	// ResultFailed means it failed without generating readable JUnit
	// files, and introspection is not possible.
	ResultFailed ResultStatus = "failed"

	// RunBrokenTestName names a "flake" which really represents the fact
	// that the entire run was broken.
	RunBrokenTestName Test = "Suite so broken it failed to produce JUnit output"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache caches test result lookups, and aggregates flakes in a single place. TODO: evict based on time. TODO: evict when issue filed. TODO: backfill to given time.

func NewCache

func NewCache(getFunc ResultFunc) *Cache

NewCache returns a new Cache.

func (*Cache) Flakes

func (c *Cache) Flakes() Flakes

Flakes lists all the current flakes, sorted.

func (*Cache) Get

func (c *Cache) Get(j Job, n Number) (*Result, error)

Get returns an item from the cache, possibly calling the lookup function passed at construction time.

type Flake

type Flake struct {
	Job
	Number
	Test
	Reason string

	// Pointer back to the result this flake came from
	*Result
}

Flake records a single flake occurrence.

type Flakes

type Flakes []Flake

Flakes is a sortable list of flakes.

func (Flakes) Len

func (f Flakes) Len() int

func (Flakes) Less

func (f Flakes) Less(i, j int) bool

func (Flakes) Swap

func (f Flakes) Swap(i, j int)

type Job

type Job string

Job is a test job, e.g. "kubernetes-e2e-gce"

type Number

type Number int

Number is a run of a test job.

type Result

type Result struct {
	// The jenkins job
	Job
	// The run number
	Number

	Status ResultStatus

	StartTime time.Time
	EndTime   time.Time

	// test name to reason/desc
	Flakes map[Test]string
}

Result records a test job completion.

type ResultFunc

type ResultFunc func(Job, Number) (*Result, error)

ResultFunc should look up the job & number from its source (GCS or wherever).

type ResultStatus

type ResultStatus string

ResultStatus can be stable, flaky, or failed

type Test

type Test string

Test is the name of an individual test that runs in a Job.

Jump to

Keyboard shortcuts

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