testgrid

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetURLResponse(string, bool) (string, error)
}

type DashboardData added in v0.13.0

type DashboardData map[DashboardName]JobData

DashboardData used to store testgrid dashboards

func ReqTestgridDashboardSummaries added in v0.13.0

func ReqTestgridDashboardSummaries(dashboardNames []DashboardName) (DashboardData, error)

ReqTestgridDashboardSummaries this function requests multiple testgrid summaries concurrently This function implements a concurrency pattern to send http requests concurrently

type DashboardName added in v0.13.0

type DashboardName string

DashboardName type for the testgrid dashboard (like sig-release-master-blocking)

const (
	// SigReleaseMasterInforming one of the dashboard names that can be used to scrapo a testgrid summary
	SigReleaseMasterInforming DashboardName = "sig-release-master-informing"
	// SigReleaseMasterBlocking one of the dashboard names that can be used to scrapo a testgrid summary
	SigReleaseMasterBlocking DashboardName = "sig-release-master-blocking"
)

type JobData added in v0.13.0

type JobData map[JobName]JobSummary

JobData used to store multiple TestgridJobs TestgridJobSummary

func ReqTestgridDashboardSummary added in v0.13.0

func ReqTestgridDashboardSummary(dashboardName DashboardName) (JobData, error)

ReqTestgridDashboardSummary used to retrieve summary information about a testgrid dashboard

func UnmarshalTestgridSummary added in v0.13.0

func UnmarshalTestgridSummary(data []byte) (JobData, error)

UnmarshalTestgridSummary used to unmarshal bytes into TestgridSummary

func (*JobData) Marshal added in v0.13.0

func (d *JobData) Marshal() ([]byte, error)

Marshal used to marshal TestgridSummary into bytes

func (*JobData) Overview added in v0.13.0

func (d *JobData) Overview() (Overview, error)

Overview used to get an overview about a testgrid dashboard

type JobName added in v0.13.0

type JobName string

JobName type for testgrid jobs

type JobSummary added in v0.13.0

type JobSummary struct {
	Alert               string        `json:"alert"`
	LastRunTimestamp    int64         `json:"last_run_timestamp"`
	LastUpdateTimestamp int64         `json:"last_update_timestamp"`
	LatestGreen         string        `json:"latest_green"`
	OverallStatus       OverallStatus `json:"overall_status"`
	OverallStatusIcon   string        `json:"overall_status_icon"`
	Status              string        `json:"status"`
	Tests               []Test        `json:"tests"`
	DashboardName       DashboardName `json:"dashboard_name"`
	BugURL              string        `json:"bug_url"`
}

JobSummary contains information about a testgrid job

func (*JobSummary) FilterSigs added in v0.13.0

func (j *JobSummary) FilterSigs() []string

FilterSigs used to filter sigs from failing tests

func (*JobSummary) FilterSuccessRateForLastRuns added in v0.13.0

func (j *JobSummary) FilterSuccessRateForLastRuns() string

FilterSuccessRateForLastRuns used to parse last runs from test example: 8 of 9 (88.9%) recent columns passed (296791 of 296793 or 100.0% cells) -> 8 of 9 (88.9%)

func (*JobSummary) GetJobURL added in v0.13.0

func (j *JobSummary) GetJobURL(jobName JobName) string

GetJobURL used to get the testgrid job url

type NotFound added in v0.14.0

type NotFound error
var ErrDashboardNotFound NotFound = errors.New("testgrid dashboard not found")

type OverallStatus added in v0.13.0

type OverallStatus string

OverallStatus of a job in testgrid

const (
	// Failing job status
	Failing OverallStatus = "FAILING"
	// Flaky job status
	Flaky OverallStatus = "FLAKY"
	// Passing job status
	Passing OverallStatus = "PASSING"
	// Stale job status
	Stale OverallStatus = "STALE"
)

type Overview added in v0.13.0

type Overview struct {
	PassingJobs []JobName
	FlakyJobs   []JobName
	FailingJobs []JobName
	StaleJobs   []JobName
}

Overview used to get an overview about a testgrid board without additional information

type SummaryLookup added in v0.13.0

type SummaryLookup struct {
	Dashboard DashboardName
	Error     error
	Summary   JobData
}

SummaryLookup this type is used if multiple testgrid summaries are getting requested concurrently

type Test added in v0.13.0

type Test struct {
	DisplayName    string        `json:"display_name"`
	TestName       string        `json:"test_name"`
	FailCount      int64         `json:"fail_count"`
	FailTimestamp  int64         `json:"fail_timestamp"`
	PassTimestamp  int64         `json:"pass_timestamp"`
	BuildLink      string        `json:"build_link"`
	BuildURLText   string        `json:"build_url_text"`
	BuildLinkText  string        `json:"build_link_text"`
	FailureMessage string        `json:"failure_message"`
	LinkedBugs     []interface{} `json:"linked_bugs"`
	FailTestLink   string        `json:"fail_test_link"`
}

Test contains information about tests if the status if the Job is failing

type TestGrid

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

TestGrid is the default test grid client

func New

func New() *TestGrid

New creates a new TestGrid

func (*TestGrid) BlockingTests

func (t *TestGrid) BlockingTests(branch string) (tests []string, err error)

BlockingTests returns the blocking tests for the provided branch name or an error if those are not available

func (*TestGrid) SetClient

func (t *TestGrid) SetClient(client Client)

SetClient can be used to set the internal HTTP client

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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