Skip to content

Commit

Permalink
Fix flakeguard aggregate cmds (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcl authored Nov 18, 2024
1 parent 4a55ba9 commit 9c9821d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var AggregateAllCmd = &cobra.Command{
}

func init() {
AggregateAllCmd.Flags().String("results-path", "testresult/", "Path to the folder containing JSON test result files")
AggregateAllCmd.Flags().String("output-results", "failed_tests.json", "Path to output the filtered failed test results in JSON format")
AggregateAllCmd.Flags().String("output-logs", "failed_logs.json", "Path to output the filtered failed test logs in JSON format")
AggregateAllCmd.Flags().String("results-path", "", "Path to the folder containing JSON test result files")
AggregateAllCmd.Flags().String("output-results", "./failed_tests.json", "Path to output the filtered failed test results in JSON format")
AggregateAllCmd.Flags().String("output-logs", "", "Path to output the filtered failed test logs in JSON format")
}
6 changes: 3 additions & 3 deletions tools/flakeguard/cmd/aggregate_failed.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ var AggregateFailedCmd = &cobra.Command{
}

func init() {
AggregateFailedCmd.Flags().String("results-path", "testresult/", "Path to the folder containing JSON test result files")
AggregateFailedCmd.Flags().String("output-results", "failed_tests.json", "Path to output the filtered failed test results in JSON format")
AggregateFailedCmd.Flags().String("output-logs", "failed_logs.json", "Path to output the filtered failed test logs in JSON format")
AggregateFailedCmd.Flags().String("results-path", "", "Path to the folder containing JSON test result files")
AggregateFailedCmd.Flags().String("output-results", "./failed_tests.json", "Path to output the filtered failed test results in JSON format")
AggregateFailedCmd.Flags().String("output-logs", "./failed_logs.json", "Path to output the filtered failed test logs in JSON format")
AggregateFailedCmd.Flags().Float64("threshold", 0.8, "Threshold for considering a test as failed")
AggregateFailedCmd.Flags().Float64("min-pass-ratio", 0.001, "Minimum pass ratio for considering a test as flaky. Used to distinguish between tests that are truly flaky (with inconsistent results) and those that are consistently failing.")
}
4 changes: 2 additions & 2 deletions tools/flakeguard/reports/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func SaveFilteredResultsAndLogs(outputResultsPath, outputLogsPath string, failed
if err := saveResults(outputResultsPath, failedResults); err != nil {
log.Fatalf("Error writing failed results to file: %v", err)
}
fmt.Printf("Filtered failed test results saved to %s\n", outputResultsPath)
fmt.Printf("Test results saved to %s\n", outputResultsPath)
} else {
fmt.Println("No failed tests found based on the specified threshold and min pass ratio.")
}
Expand All @@ -167,7 +167,7 @@ func SaveFilteredResultsAndLogs(outputResultsPath, outputLogsPath string, failed
if err := saveTestOutputs(outputLogsPath, failedResults); err != nil {
log.Fatalf("Error writing failed logs to file: %v", err)
}
fmt.Printf("Filtered failed test logs saved to %s\n", outputLogsPath)
fmt.Printf("Test logs saved to %s\n", outputLogsPath)
}
}

Expand Down

0 comments on commit 9c9821d

Please sign in to comment.