Skip to content

Commit 0822252

Browse files
committed
fix: hide redundant segment breakdown when all tests pass
The "✅ 9 passed" line duplicates information already in the summary line ("9 tests completed in 1.9s — 100.0% passed"). Only show the segment breakdown when there are multiple categories.
1 parent 048fffc commit 0822252

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

TUnit.Engine/Reporters/GitHubReporter.cs

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,34 +167,38 @@ public Task AfterRunAsync(int exitCode, CancellationToken cancellation)
167167
stringBuilder.AppendLine($"**{totalCount} tests** completed in **{FormatDuration(elapsed)}** \u2014 **{passRate:F1}%** passed");
168168
stringBuilder.AppendLine();
169169

170-
var segments = new List<string> { $"\u2705 {passedCount} passed" };
171-
172-
if (failed.Length > 0)
170+
// Only show the segment breakdown when there's more than just "N passed"
171+
if (passedCount != totalCount)
173172
{
174-
segments.Add($"\u274C {failed.Length} failed");
175-
}
173+
var segments = new List<string> { $"\u2705 {passedCount} passed" };
176174

177-
if (skipped.Length > 0)
178-
{
179-
segments.Add($"\u23ED\uFE0F {skipped.Length} skipped");
180-
}
175+
if (failed.Length > 0)
176+
{
177+
segments.Add($"\u274C {failed.Length} failed");
178+
}
181179

182-
if (timeout.Length > 0)
183-
{
184-
segments.Add($"\u23F1\uFE0F {timeout.Length} timed out");
185-
}
180+
if (skipped.Length > 0)
181+
{
182+
segments.Add($"\u23ED\uFE0F {skipped.Length} skipped");
183+
}
186184

187-
if (cancelled.Length > 0)
188-
{
189-
segments.Add($"\uD83D\uDEAB {cancelled.Length} cancelled");
190-
}
185+
if (timeout.Length > 0)
186+
{
187+
segments.Add($"\u23F1\uFE0F {timeout.Length} timed out");
188+
}
191189

192-
if (inProgress.Length > 0)
193-
{
194-
segments.Add($"\u26A0\uFE0F {inProgress.Length} in progress");
195-
}
190+
if (cancelled.Length > 0)
191+
{
192+
segments.Add($"\uD83D\uDEAB {cancelled.Length} cancelled");
193+
}
194+
195+
if (inProgress.Length > 0)
196+
{
197+
segments.Add($"\u26A0\uFE0F {inProgress.Length} in progress");
198+
}
196199

197-
stringBuilder.AppendLine(string.Join(" \u00B7 ", segments));
200+
stringBuilder.AppendLine(string.Join(" \u00B7 ", segments));
201+
}
198202

199203
// Detect flaky tests (passed after retry)
200204
var flakyTests = new List<(string Name, int Attempts, TimeSpan? Duration)>();

0 commit comments

Comments
 (0)