Skip to content

Commit 2185a8f

Browse files
committed
fix run
1 parent fe97280 commit 2185a8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/flakeguard/cmd/run.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ var RunTestsCmd = &cobra.Command{
8383
fmt.Printf("All test results saved to %s\n", outputPath)
8484
}
8585

86+
if len(testReport.Results) == 0 {
87+
fmt.Printf("No tests were run for the specified packages.\n")
88+
return
89+
}
90+
8691
// Filter flaky tests using FilterTests
8792
flakyTests := reports.FilterTests(testReport.Results, func(tr reports.TestResult) bool {
8893
return !tr.Skipped && tr.PassRatio < maxPassRatio
@@ -94,8 +99,6 @@ var RunTestsCmd = &cobra.Command{
9499
reports.RenderResults(os.Stdout, flakyTests, maxPassRatio, false)
95100
// Exit with error code if there are flaky tests
96101
os.Exit(1)
97-
} else if len(testReport.Results) == 0 {
98-
fmt.Printf("No tests were run for the specified packages.\n")
99102
}
100103
},
101104
}

0 commit comments

Comments
 (0)