flakereport

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCliApp

func NewCliApp() *cli.App

NewCliApp instantiates a new instance of the CLI application

Types

type ArtifactJob

type ArtifactJob struct {
	Repo         string
	RunID        int64
	RunCreatedAt time.Time
	Artifact     WorkflowArtifact
	TempDir      string
	RunNumber    int
	TotalRuns    int
	ArtifactNum  int
}

ArtifactJob represents a job to download and process an artifact

type ArtifactResult

type ArtifactResult struct {
	Failures []TestFailure
	AllRuns  []TestRun
	Error    error
}

ArtifactResult represents the result of processing an artifact

type ArtifactsResponse

type ArtifactsResponse struct {
	TotalCount int                `json:"total_count"`
	Artifacts  []WorkflowArtifact `json:"artifacts"`
}

ArtifactsResponse represents the GitHub API response for artifacts

type FailedTestRecord

type FailedTestRecord struct {
	SuiteName   string `json:"suite_name"`
	TestName    string `json:"test_name"`
	FailureDate string `json:"failure_date"`
	Link        string `json:"link"`
	FailureType string `json:"failure_type"`
}

FailedTestRecord represents a single test failure for the failures.json analytics export

type ReportSummary

type ReportSummary struct {
	FlakyTests         []TestReport
	Timeouts           []TestReport  // Tests ending with "(timeout)"
	Crashes            []TestReport  // Tests containing "crash"
	CIBreakers         []TestReport  // Tests that failed all retries (3x) in a single job
	Suites             []SuiteReport // Per-suite flake breakdown
	TotalFailures      int           // Total raw failure count
	TotalTestRuns      int           // Total test executions (all tests, all runs)
	OverallFailureRate float64       // Overall failures per 1000 test runs
	TotalFlakyCount    int           // Total flaky tests (not just top 10)
	TotalWorkflowRuns  int           // Total workflow runs analyzed
	SuccessfulRuns     int           // Workflow runs that succeeded
}

ReportSummary contains all processed report data

type SlackBlock

type SlackBlock struct {
	Type   string      `json:"type"`
	Text   *SlackText  `json:"text,omitempty"`
	Fields []SlackText `json:"fields,omitempty"`
}

type SlackMessage

type SlackMessage struct {
	Text   string       `json:"text"`
	Blocks []SlackBlock `json:"blocks"`
}

SlackMessage represents Slack Block Kit message

type SlackText

type SlackText struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type SuiteReport

type SuiteReport struct {
	SuiteName   string    // Test suite name from JUnit XML
	FlakeRate   float64   // Percentage of job executions with at least one non-retry failure
	FailedRuns  int       // Number of job executions with at least one non-retry failure
	TotalRuns   int       // Total number of job executions where this suite appeared
	LastFailure time.Time // Timestamp of the most recent failure
}

SuiteReport represents aggregated flake data for a test suite

type TestFailure

type TestFailure struct {
	ClassName  string    // Test class/module name
	Name       string    // Test function name
	SuiteName  string    // Top-level test suite name
	ArtifactID string    // Artifact identifier from GitHub
	RunID      int64     // GitHub Actions run ID
	JobID      string    // GitHub Actions job ID (or "unknown")
	MatrixName string    // DB config name from artifact name (e.g. "sqlite", "cassandra")
	Timestamp  time.Time // When the workflow run was created
}

TestFailure represents a single test failure extracted from JUnit XML

type TestReport

type TestReport struct {
	TestName     string    // Normalized test name (retry suffix stripped)
	FailureCount int       // Total number of failures
	TotalRuns    int       // Total number of times this test ran (including successes)
	GitHubURLs   []string  // Up to max_links failure URLs
	LastFailure  time.Time // Timestamp of the most recent failure
}

TestReport represents aggregated failures for a single test

type TestRun

type TestRun struct {
	SuiteName  string // Top-level test suite name
	Name       string // Test name
	Failed     bool   // Whether the test failed
	Skipped    bool   // Whether the test was skipped
	RunID      int64  // Workflow run ID
	JobID      string // GitHub Actions job ID (unique per matrix job/shard)
	MatrixName string // DB config name from artifact name (e.g. "sqlite", "cassandra")
}

TestRun represents a test execution (success or failure)

type WorkflowArtifact

type WorkflowArtifact struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	Expired   bool      `json:"expired"`
}

WorkflowArtifact represents a downloadable artifact

type WorkflowRun

type WorkflowRun struct {
	ID         int64     `json:"id"`
	Number     int       `json:"run_number"`
	CreatedAt  time.Time `json:"created_at"`
	Status     string    `json:"status"`
	Conclusion string    `json:"conclusion"`
	HeadBranch string    `json:"head_branch"`
}

WorkflowRun represents a GitHub Actions workflow run

Jump to

Keyboard shortcuts

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