Documentation ¶
Index ¶
- Variables
- func RunChecks(checks []FailureModeCheck, to *TestingOutputs, outputsDir string) ([]runtests.TestDetails, error)
- type FailureModeCheck
- type MassTestFailureCheck
- type NoTestsRanCheck
- type SwarmingRpcsFilesRef
- type SwarmingRpcsStringListPair
- type SwarmingRpcsTaskResult
- type SwarmingTaskSummary
- type TestingOutputs
Constants ¶
This section is empty.
Variables ¶
var TaskStateChecks []FailureModeCheck = []FailureModeCheck{
&taskInternalFailureCheck{},
&taskFailureCheck{},
&taskStateCheck{State: "BOT_DIED"},
&taskStateCheck{State: "CANCELED"},
&taskStateCheck{State: "EXPIRED"},
&taskStateCheck{State: "INVALID"},
&taskStateCheck{State: "KILLED"},
&taskStateCheck{State: "NO_RESOURCE"},
&taskStateCheck{State: "PENDING"},
&taskStateCheck{State: "RUNNING"},
&taskStateCheck{State: "TIMED_OUT"},
}
TaskStateChecks contains checks to cover every possible state. A task can only be in one state, so their relative order doesn't matter.
Functions ¶
func RunChecks ¶
func RunChecks(checks []FailureModeCheck, to *TestingOutputs, outputsDir string) ([]runtests.TestDetails, error)
RunChecks runs the given checks on the given TestingOutputs. It always returns the same list of tests, with one corresponding to each check. A failed test means the Check() returned true. After the first failed test, all later Checks() will be skipped. Passed tests will be returned for each skipped check. Rationale: We want these tests to be useful for bucketing via Flake Fetcher. In order for our infrastructure to consider a test as flaky, we need it to sometimes pass and sometimes fail, which means we should always return a test even if it passed or was skipped. In order for these bugs to be useful, we want a failure to be associated only with the most specific, helpful failure modes, which then get routed to specific bugs.
Types ¶
type FailureModeCheck ¶
type FailureModeCheck interface { // Check analyzes TestingOutputs and returns true if the failure mode was detected. Check(*TestingOutputs) bool // Name is the name of this check. Name() string // DebugText is human-readable text intended to help debug a check failure. DebugText() string }
FailureModeCheck checks whether a failure mode appears.
func StringInLogsChecks ¶
func StringInLogsChecks() (ret []FailureModeCheck)
StringInLogsChecks returns checks to detect bad strings in certain logs.
type MassTestFailureCheck ¶
type MassTestFailureCheck struct {
MaxFailed int
}
func (MassTestFailureCheck) Check ¶
func (c MassTestFailureCheck) Check(to *TestingOutputs) bool
func (MassTestFailureCheck) DebugText ¶
func (c MassTestFailureCheck) DebugText() string
func (MassTestFailureCheck) Name ¶
func (c MassTestFailureCheck) Name() string
type NoTestsRanCheck ¶
type NoTestsRanCheck struct{}
NoTestsRanCheck checks whether the task reported running zero tests. It may actually have run tests but not reported them, which is still an issue.
func (NoTestsRanCheck) Check ¶
func (c NoTestsRanCheck) Check(to *TestingOutputs) bool
func (NoTestsRanCheck) DebugText ¶
func (c NoTestsRanCheck) DebugText() string
func (NoTestsRanCheck) Name ¶
func (c NoTestsRanCheck) Name() string
type SwarmingRpcsFilesRef ¶
type SwarmingRpcsFilesRef struct { Isolated string `json:"isolated,omitempty"` Isolatedserver string `json:"isolatedserver,omitempty"` Namespace string `json:"namespace,omitempty"` }
SwarmingRpcsFilesRef is a reference to an isolated file on an isolate server.
type SwarmingRpcsStringListPair ¶
type SwarmingRpcsStringListPair struct { Key string `json:"key,omitempty"` Value []string `json:"value,omitempty"` }
SwarmingRpcsStringListPair represents a mapping of string to list of strings.
type SwarmingRpcsTaskResult ¶
type SwarmingRpcsTaskResult struct { // BotDimensions: Represents a mapping of string to list of strings. BotDimensions []*SwarmingRpcsStringListPair `json:"bot_dimensions,omitempty"` BotId string `json:"bot_id,omitempty"` BotVersion string `json:"bot_version,omitempty"` CurrentTaskSlice int64 `json:"current_task_slice,omitempty,string"` DedupedFrom string `json:"deduped_from,omitempty"` Duration float64 `json:"duration,omitempty"` ExitCode int64 `json:"exit_code,omitempty,string"` Failure bool `json:"failure,omitempty"` InternalFailure bool `json:"internal_failure,omitempty"` Name string `json:"name,omitempty"` // OutputsRef: Defines a data tree reference for Swarming task inputs or // outputs. It can either be: - a reference to an isolated file on an // isolate server - a reference to an isolated file on a RBE CAS server // In the RBE CAS case, the isolatedserver must be set to GCP name, and // namespace must be set to "sha256-GCP". For the moment, RBE CAS // requires SHA-256 and doesn't support precompressed data. OutputsRef *SwarmingRpcsFilesRef `json:"outputs_ref,omitempty"` RunId string `json:"run_id,omitempty"` ServerVersions []string `json:"server_versions,omitempty"` StartedTs string `json:"started_ts,omitempty"` // Possible values: // "BOT_DIED" // "CANCELED" // "COMPLETED" // "EXPIRED" // "INVALID" // "KILLED" // "NO_RESOURCE" // "PENDING" // "RUNNING" // "TIMED_OUT" State string `json:"state,omitempty"` Tags []string `json:"tags,omitempty"` TaskId string `json:"task_id,omitempty"` TryNumber int64 `json:"try_number,omitempty,string"` User string `json:"user,omitempty"` }
SwarmingRpcsTaskResult is the result of a single task execution. This is based on the type of the same name in go.chromium.org/luci/common/api/swarming/swarming/v1, but we include only the fields we care about.
type SwarmingTaskSummary ¶
type SwarmingTaskSummary struct { Outputs []string `json:"outputs,omitempty"` Results *SwarmingRpcsTaskResult `json:"results"` Host string }
SwarmingTaskSummary is the summary of an individual task found in the output of `swarming collect`.
func (*SwarmingTaskSummary) BotURL ¶
func (sts *SwarmingTaskSummary) BotURL() string
BotURL returns the Swarming UI URL for the bot the task ran on.
func (*SwarmingTaskSummary) TaskURL ¶
func (sts *SwarmingTaskSummary) TaskURL() string
TaskURL returns the Swarming UI URL for the task.
type TestingOutputs ¶
type TestingOutputs struct { TestSummary *runtests.TestSummary SwarmingSummary *SwarmingTaskSummary SerialLog []byte SwarmingOutput []byte Syslog []byte }
TestingOutputs are the outputs of a testing Swarming task that are analyzed by a FailureModeCheck.