Skip to content

Commit 99a4ea2

Browse files
committed
Update output messages for rerun tests and add JSON output path check
1 parent 8576bda commit 99a4ea2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tools/flakeguard/cmd/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ var RunTestsCmd = &cobra.Command{
159159
os.Exit(ErrorExitCode)
160160
}
161161

162-
fmt.Printf("\nAll Rerun Tests:\n")
162+
fmt.Printf("\nAll Tests That Were Rerun:\n")
163163
reports.PrintTestResultsTable(os.Stdout, rerunReport.Results, false, false)
164164
fmt.Println()
165165

@@ -178,7 +178,7 @@ var RunTestsCmd = &cobra.Command{
178178
})
179179

180180
if len(failedAfterRerun) > 0 {
181-
fmt.Printf("\nTests That Failed All %d Reruns:\n", rerunFailedCount)
181+
fmt.Printf("\nTests That Have 0 Success Runs:\n")
182182
reports.PrintTestResultsTable(os.Stdout, failedAfterRerun, false, false)
183183
fmt.Println()
184184

tools/flakeguard/reports/data.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ func (testReport *TestReport) SaveToFile(outputPath string) error {
4848
}
4949

5050
func (tr *TestReport) PrintGotestsumOutput(format string) error {
51+
if len(tr.JSONOutputPaths) == 0 {
52+
fmt.Printf("No JSON output paths found in test report\n")
53+
return nil
54+
}
55+
56+
fmt.Println("---------------------")
5157
for _, path := range tr.JSONOutputPaths {
5258
cmdStr := fmt.Sprintf("cat %q | gotestsum --raw-command --format %q -- cat", path, format)
5359
cmd := exec.Command("bash", "-c", cmdStr)

0 commit comments

Comments
 (0)