Documentation ¶
Overview ¶
Package lucianalysis contains methods to query test failures maintained in BigQuery.
Index ¶
- Constants
- type BuildInfo
- type BuilderRegressionGroup
- type Client
- func (c *Client) Close() error
- func (c *Client) ReadBuildInfo(ctx context.Context, tf *model.TestFailure) (BuildInfo, error)
- func (c *Client) ReadLatestVerdict(ctx context.Context, project string, keys []TestVerdictKey) (map[TestVerdictKey]TestVerdictResult, error)
- func (c *Client) ReadTestFailures(ctx context.Context, task *tpb.TestFailureDetectionTask, ...) ([]*BuilderRegressionGroup, error)
- func (c *Client) TestIsUnexpectedConsistently(ctx context.Context, project string, key TestVerdictKey, ...) (bool, error)
- type CountRow
- type Gitiles
- type Ref
- type TestVariant
- type TestVerdictKey
- type TestVerdictResult
- type TestVerdictResultRow
Constants ¶
const BuildBucketProject = "cr-buildbucket"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) ReadBuildInfo ¶
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) ReadTestFailures ¶
func (c *Client) ReadTestFailures(ctx context.Context, task *tpb.TestFailureDetectionTask, filter *configpb.FailureIngestionFilter) ([]*BuilderRegressionGroup, error)
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 Gitiles ¶
type Gitiles struct { Host bigquery.NullString Project bigquery.NullString Ref bigquery.NullString }
type TestVariant ¶
type TestVariant struct { TestID bigquery.NullString VariantHash bigquery.NullString Variant bigquery.NullJSON StartPositionUnexpectedResultRate float64 EndPositionUnexpectedResultRate float64 }
type TestVerdictKey ¶
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 }