baselines

package
v0.0.0-...-8ff35f7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package baselines captures baseline objects and basic interactions with them.

Index

Constants

View Source
const SpinUpDuration = 72 * time.Hour

Variables

View Source
var NotFound = errors.New("baseline not found")

NotFound is the error returned by Read if the row could not be found.

Functions

func Create

func Create(project, baselineID string) *spanner.Mutation

Create returns a Spanner mutation that creates the baseline, setting CreationTime and LastUpdatedTime to spanner.CommitTimestamp

func MustParseBaselineName

func MustParseBaselineName(name string) (project, baselineID string)

MustParseBaselineName parses a baseline name to project and baselineID. Panics if the name is invalid. Useful for situations when name was already validated.

func UpdateLastUpdatedTime

func UpdateLastUpdatedTime(project, baselineID string) *spanner.Mutation

UpdateLastUpdatedTime refreshes a Baseline's LastUpdatedTime.

Types

type Baseline

type Baseline struct {
	Project         string
	BaselineID      string
	LastUpdatedTime time.Time
	CreationTime    time.Time
}

Baseline captures baseline identifiers, which map to a set of test variants. When determining new tests, baselines that have been created within 3 days are considered to be in a spin up state, and will not be able to calculate new tests.

func Read

func Read(ctx context.Context, project, baselineID string) (*Baseline, error)

Read reads the baseline with the given LUCI project and baseline ID. If the row does not exist, the error NotFound is returned.

func (Baseline) IsSpinningUp

func (b Baseline) IsSpinningUp(now time.Time) bool

IsSpinningUp checks whether the creation time is within 72 hours.

Directories

Path Synopsis
Package baselinetestvariant provides crud operations for baseline test variants.
Package baselinetestvariant provides crud operations for baseline test variants.

Jump to

Keyboard shortcuts

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