reports

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintTests

func PrintTests(tests []TestResult, w io.Writer)

PrintTests prints tests in a pretty format

func SaveFilteredResultsAndLogs

func SaveFilteredResultsAndLogs(outputResultsPath, outputLogsPath string, failedResults []TestResult)

Helper function to save filtered results and logs to specified paths

Types

type TestResult

type TestResult struct {
	TestName            string
	TestPackage         string
	Panicked            bool            // Indicates a test-level panic
	Skipped             bool            // Indicates if the test was skipped
	PackagePanicked     bool            // Indicates a package-level panic
	PassRatio           float64         // Pass ratio in decimal format like 0.5
	PassRatioPercentage string          // Pass ratio in percentage format like "50%"
	Runs                int             // Count of how many times the test was run
	Failures            int             // Count of how many times the test failed
	Successes           int             // Count of how many times the test passed
	Panics              int             // Count of how many times the test panicked
	Races               int             // Count of how many times the test encountered a data race
	Skips               int             // Count of how many times the test was skipped
	Outputs             []string        `json:"outputs,omitempty"` // Stores outputs for a test
	Durations           []time.Duration // Stores elapsed time for each run of the test
	PackageOutputs      []string        `json:"package_outputs,omitempty"` // Stores package-level outputs
}

TestResult represents the result of a single test being run through flakeguard.

func AggregateTestResults

func AggregateTestResults(folderPath string) ([]TestResult, error)

AggregateTestResults aggregates all JSON test results.

func FilterFailedTests

func FilterFailedTests(results []TestResult, maxPassRatio float64) []TestResult

FilterFailedTests returns a slice of TestResult where the pass ratio is below the specified threshold.

func FilterFlakyTests

func FilterFlakyTests(testResults []TestResult, maxPassRatio float64) []TestResult

FilterFlakyTests returns a slice of TestResult where the pass ratio is between the min pass ratio and the threshold.

func FilterPassedTests

func FilterPassedTests(results []TestResult, maxPassRatio float64) []TestResult

FilterPassedTests returns a slice of TestResult where the tests passed and were not skipped.

func FilterSkippedTests

func FilterSkippedTests(results []TestResult) []TestResult

FilterSkippedTests returns a slice of TestResult where the tests were skipped.

Jump to

Keyboard shortcuts

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