lucianalysis

package
v0.0.0-...-add0f8d Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package lucianalysis contains methods to query test failures maintained in BigQuery.

Index

Constants

View Source
const BuildBucketProject = "cr-buildbucket"

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	BuildID         int64
	StartCommitHash string
	EndCommitHash   string
}

type BuilderRegressionGroup

type BuilderRegressionGroup struct {
	Bucket                  bigquery.NullString
	Builder                 bigquery.NullString
	RefHash                 bigquery.NullString
	Ref                     *Ref
	RegressionStartPosition bigquery.NullInt64
	RegressionEndPosition   bigquery.NullInt64
	TestVariants            []*TestVariant
	StartHour               bigquery.NullTimestamp
	EndHour                 bigquery.NullTimestamp
	SheriffRotations        []bigquery.NullString
}

BuilderRegressionGroup contains a list of test variants which use the same builder and have the same regression range.

type Client

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

Client may be used to read LUCI Analysis test failures.

func NewClient

func NewClient(ctx context.Context, gcpProject string, luciAnalysisProjectFunc func(luciProject string) string) (*Client, error)

NewClient creates a new client for reading test failures from LUCI Analysis. Close() MUST be called after you have finished using this client. GCP project where the query operations are billed to, either luci-bisection or luci-bisection-dev. luciAnalysisProject is the function that returns the gcp project that contains the BigQuery table we want to query.

func (*Client) Close

func (c *Client) Close() error

Close releases any resources held by the client.

func (*Client) ReadBuildInfo

func (c *Client) ReadBuildInfo(ctx context.Context, tf *model.TestFailure) (BuildInfo, error)

func (*Client) ReadLatestVerdict

func (c *Client) ReadLatestVerdict(ctx context.Context, project string, keys []TestVerdictKey) (map[TestVerdictKey]TestVerdictResult, error)

ReadLatestVerdict queries LUCI Analysis for latest verdict. It supports querying for multiple keys at a time to save time and resources. Returns a map of TestVerdictKey -> latest verdict.

func (*Client) TestIsUnexpectedConsistently

func (c *Client) TestIsUnexpectedConsistently(ctx context.Context, project string, key TestVerdictKey, sinceCommitPosition int64) (bool, error)

TestIsUnexpectedConsistently queries LUCI Analysis to see if a test is still unexpected deterministically since a commit position. This is to be called before we take a culprit action, in case a test status has changed.

type CountRow

type CountRow struct {
	Count bigquery.NullInt64
}

type Gitiles

type Gitiles struct {
	Host    bigquery.NullString
	Project bigquery.NullString
	Ref     bigquery.NullString
}

type Ref

type Ref struct {
	Gitiles *Gitiles
}

type TestVariant

type TestVariant struct {
	TestID                            bigquery.NullString
	VariantHash                       bigquery.NullString
	Variant                           bigquery.NullJSON
	StartPositionUnexpectedResultRate float64
	EndPositionUnexpectedResultRate   float64
}

type TestVerdictKey

type TestVerdictKey struct {
	TestID      string
	VariantHash string
	RefHash     string
}

type TestVerdictResult

type TestVerdictResult struct {
	TestName string
	Status   pb.TestVerdictStatus
}

type TestVerdictResultRow

type TestVerdictResultRow struct {
	TestID      bigquery.NullString
	VariantHash bigquery.NullString
	RefHash     bigquery.NullString
	TestName    bigquery.NullString
	Status      bigquery.NullString
}

Jump to

Keyboard shortcuts

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