lowlatency

package
v0.0.0-...-be266f5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package lowlatency contains methods for accessing the low-latency test results table in Spanner.

Index

Constants

This section is empty.

Variables

View Source
var TestResultSaveCols = []string{
	"Project", "TestId", "VariantHash", "SourceRefHash", "SourcePosition",
	"RootInvocationId", "InvocationId", "ResultId", "PartitionTime", "SubRealm",
	"IsUnexpected", "Status", "ChangelistHosts", "ChangelistChanges",
	"ChangelistPatchsets", "ChangelistOwnerKinds", "HasDirtySources",
}

TestResultSaveCols is the set of columns written to in a test result save. Allocated here once to avoid reallocating on every test result save.

Functions

This section is empty.

Types

type RunStatus

type RunStatus int64
const (
	Unexpected RunStatus = iota
	Flaky
	Expected
)

type TestResult

type TestResult struct {
	Project          string
	TestID           string
	VariantHash      string
	Sources          testresults.Sources
	RootInvocationID string
	InvocationID     string
	ResultID         string
	PartitionTime    time.Time
	SubRealm         string
	IsUnexpected     bool
	Status           pb.TestResultStatus
}

TestResult represents a row in the TestResultsBySourcePosition table.

func ReadAllForTesting

func ReadAllForTesting(ctx context.Context) ([]*TestResult, error)

ReadAllForTesting reads all test results from the TestResultsBySourcePosition table for testing. Must be called in a spanner transactional context.

func (*TestResult) SaveUnverified

func (tr *TestResult) SaveUnverified() *spanner.Mutation

SaveUnverified prepare a mutation to insert the test result into the TestResultsBySourcePosition table. The test result is not validated.

type TestResultBuilder

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

TestResultBuilder provides methods to build a test result for testing.

func NewTestResult

func NewTestResult() TestResultBuilder

func (TestResultBuilder) Build

func (b TestResultBuilder) Build() *TestResult

func (TestResultBuilder) WithInvocationID

func (b TestResultBuilder) WithInvocationID(invID string) TestResultBuilder

func (TestResultBuilder) WithIsUnexpected

func (b TestResultBuilder) WithIsUnexpected(isUnexpected bool) TestResultBuilder

WithIsUnexpected specifies whether the test result is unexpected.

func (TestResultBuilder) WithPartitionTime

func (b TestResultBuilder) WithPartitionTime(partitionTime time.Time) TestResultBuilder

WithPartitionTime specifies the partition time of the test result.

func (TestResultBuilder) WithProject

func (b TestResultBuilder) WithProject(project string) TestResultBuilder

func (TestResultBuilder) WithResultID

func (b TestResultBuilder) WithResultID(resultID string) TestResultBuilder

func (TestResultBuilder) WithRootInvocationID

func (b TestResultBuilder) WithRootInvocationID(rootInvID string) TestResultBuilder

func (TestResultBuilder) WithSources

func (b TestResultBuilder) WithSources(sources testresults.Sources) TestResultBuilder

func (TestResultBuilder) WithStatus

WithStatus specifies the status of the test result.

func (TestResultBuilder) WithSubRealm

func (b TestResultBuilder) WithSubRealm(subRealm string) TestResultBuilder

WithSubRealm specifies the subrealm of the test result.

func (TestResultBuilder) WithTestID

func (b TestResultBuilder) WithTestID(testID string) TestResultBuilder

func (TestResultBuilder) WithVariantHash

func (b TestResultBuilder) WithVariantHash(variantHash string) TestResultBuilder

type TestVerdictBuilder

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

TestVerdictBuilder provides methods to build a test variant for testing.

func NewTestVerdict

func NewTestVerdict() *TestVerdictBuilder

func (*TestVerdictBuilder) Build

func (b *TestVerdictBuilder) Build() []*TestResult

func (*TestVerdictBuilder) WithBaseTestResult

func (b *TestVerdictBuilder) WithBaseTestResult(testResult *TestResult) *TestVerdictBuilder

WithBaseTestResult specifies a test result to use as the template for the test variant's test results.

func (*TestVerdictBuilder) WithRunStatus

func (b *TestVerdictBuilder) WithRunStatus(runStatuses ...RunStatus) *TestVerdictBuilder

WithRunStatus specifies the status of runs of the test verdict.

Jump to

Keyboard shortcuts

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