Skip to content

Commit d4d2140

Browse files
committed
Tweak order
1 parent 9d39ff3 commit d4d2140

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

tools/flakeguard/reports/reports.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
"sort"
1212
"strings"
1313
"time"
14+
15+
"golang.org/x/text/language"
16+
"golang.org/x/text/message"
1417
)
1518

1619
// TestReport represents the report of all tests run through flakeguard.
@@ -189,14 +192,15 @@ func PrintTests(
189192
tests []TestResult,
190193
maxPassRatio float64,
191194
) (runs, passes, fails, skips, panickedTests, racedTests, flakyTests int) {
195+
p := message.NewPrinter(language.English) // For formatting numbers
192196
sortTestResults(tests)
193197
headers := []string{
194198
"**Name**",
195199
"**Pass Ratio**",
196-
"**Runs**",
197200
"**Panicked?**",
198201
"**Timed Out?**",
199202
"**Race?**",
203+
"**Runs**",
200204
"**Successes**",
201205
"**Failures**",
202206
"**Skips**",
@@ -212,13 +216,13 @@ func PrintTests(
212216
rows = append(rows, []string{
213217
test.TestName,
214218
fmt.Sprintf("%.2f%%", test.PassRatio*100),
215-
fmt.Sprintf("%d", test.Runs),
216219
fmt.Sprintf("%t", test.Panic),
217220
fmt.Sprintf("%t", test.Timeout),
218221
fmt.Sprintf("%t", test.Race),
219-
fmt.Sprintf("%d", test.Successes),
220-
fmt.Sprintf("%d", test.Failures),
221-
fmt.Sprintf("%d", test.Skips),
222+
p.Sprintf("%d", test.Runs),
223+
p.Sprintf("%d", test.Successes),
224+
p.Sprintf("%d", test.Failures),
225+
p.Sprintf("%d", test.Skips),
222226
test.TestPackage,
223227
fmt.Sprintf("%t", test.PackagePanic),
224228
avgDuration(test.Durations).String(),
@@ -259,15 +263,15 @@ func PrintTests(
259263
// Print out summary data
260264
summaryData := [][]string{
261265
{"**Category**", "**Total**"},
262-
{"**Tests**", fmt.Sprint(len(tests))},
263-
{"**Panicked Tests**", fmt.Sprint(panickedTests)},
264-
{"**Raced Tests**", fmt.Sprint(racedTests)},
265-
{"**Flaky Tests**", fmt.Sprint(flakyTests)},
266+
{"**Tests**", p.Sprint(len(tests))},
267+
{"**Panicked Tests**", p.Sprint(panickedTests)},
268+
{"**Raced Tests**", p.Sprint(racedTests)},
269+
{"**Flaky Tests**", p.Sprint(flakyTests)},
266270
{"**Flaky Test Ratio**", flakeRatioStr},
267-
{"**Runs**", fmt.Sprint(runs)},
268-
{"**Passes**", fmt.Sprint(passes)},
269-
{"**Failures**", fmt.Sprint(fails)},
270-
{"**Skips**", fmt.Sprint(skips)},
271+
{"**Runs**", p.Sprint(runs)},
272+
{"**Passes**", p.Sprint(passes)},
273+
{"**Failures**", p.Sprint(fails)},
274+
{"**Skips**", p.Sprint(skips)},
271275
{"**Pass Ratio**", passRatioStr},
272276
}
273277
colWidths := make([]int, len(summaryData[0]))

0 commit comments

Comments
 (0)