Skip to content

Commit e8ad4b4

Browse files
committed
Tweak sorting
1 parent 31eb9ae commit e8ad4b4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tools/flakeguard/reports/reports.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ func PrintTests(
194194
"**Test**",
195195
"**Pass Ratio**",
196196
"**Runs**",
197-
"**Test Panicked?**",
198-
"**Test Timed Out?**",
199-
"**Test Race?**",
197+
"**Panicked?**",
198+
"**Timed Out?**",
199+
"**Race?**",
200200
"**Successes**",
201201
"**Failures**",
202202
"**Skips**",
@@ -468,15 +468,15 @@ func avgDuration(durations []time.Duration) time.Duration {
468468
return total / time.Duration(len(durations))
469469
}
470470

471-
// sortTestResults sorts results by PassRatio, TestPackage, and TestName for consistent comparison and pretty printing
471+
// sortTestResults sorts results by TestPackage, TestName, and PassRatio for consistent comparison and pretty printing
472472
func sortTestResults(results []TestResult) {
473473
sort.Slice(results, func(i, j int) bool {
474-
if results[i].PassRatio != results[j].PassRatio {
475-
return results[i].PassRatio < results[j].PassRatio
476-
}
477-
if results[i].TestName == results[j].TestName {
474+
if results[i].TestPackage != results[j].TestPackage {
478475
return results[i].TestPackage < results[j].TestPackage
479476
}
480-
return results[i].TestName < results[j].TestName
477+
if results[i].TestName != results[j].TestName {
478+
return results[i].TestName < results[j].TestName
479+
}
480+
return results[i].PassRatio < results[j].PassRatio
481481
})
482482
}

0 commit comments

Comments
 (0)