Add per-assembly test counts to dotnet test summary (#52128)#54513
Open
Evangelink wants to merge 1 commit into
Open
Add per-assembly test counts to dotnet test summary (#52128)#54513Evangelink wants to merge 1 commit into
Evangelink wants to merge 1 commit into
Conversation
When `dotnet test` runs multiple test assemblies, the mid-stream completion line and the final per-assembly recap previously showed only the status and duration. Users had to scroll back through the run to see how many tests passed / failed / were skipped in each individual assembly. This change appends a compact bracketed counts block that mirrors the in- progress indicator exactly (same glyphs, same order, same colors): Full-ANSI: [✓P/xF/↓S] with optional /rR for retries SimpleTerminal: [+P/xF/?S] with optional /rR for retries The non-ANSI form re-uses the ASCII glyphs that `SimpleTerminal.RenderProgress` already emits, so logs stay font- and encoding-friendly in CI and redirected output. Tests: - `TerminalTestReporterTests` - 3 new unit tests covering mid-stream completion, multi-assembly final summary, and retried tests - `GivenDotnetTestBuildsAndRunsTests` - the two existing multi-project acceptance tests now also assert the per-assembly counts via a new `GeneratePerAssemblyCountsRegexPattern` helper Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52128.
When
dotnet testruns multiple test assemblies, the per-assembly status lines previously only showed status and duration. Users had to scroll to the global summary to see the per-assembly breakdown. This change adds a compact counts block to the per-assembly summary lines that re-uses the exact same glyphs, order, and colors as the in-progress indicator, so the format stays narrow and visually consistent with what users already train on.Format
AnsiTerminal[✓P/xF/↓S](plus/rRwhen retries occurred)SimpleTerminal(CI / redirected /--no-ansi)[+P/xF/?S](plus/rRwhen retries occurred)The terminal-specific glyphs mirror
SimpleTerminal.RenderProgressexactly, so logs stay font- and encoding-friendly in CI environments. Colors (DarkGreen / DarkRed / DarkYellow / Gray) and order (passed / failed / skipped / retried) matchAnsiTerminalTestProgressFrame.Sample output (subprocess →
NonAnsiTerminal→ ASCII form)The bracket block appears between the status word (
passed/failed with N error(s)/Zero tests ran) and the duration in both call sites ofAppendAssemblySummary: the mid-stream completion line, and the final per-assembly recap (only when more than one assembly ran, since the global summary already covers the single-assembly case).Tests
TerminalTestReporterTests- 3 new unit tests viaCapturingConsolecovering the mid-stream completion line, the multi-assembly final summary, and the retried-tests path. Assertions use the ASCII glyph form because the tests run inAnsiMode.SimpleAnsi.GivenDotnetTestBuildsAndRunsTests- the two existing multi-project acceptance tests (RunMultipleTestProjectsWithFailingTestsandRunMultipleTestProjectsWithDifferentFailures) now also assert the per-assembly counts via a newGeneratePerAssemblyCountsRegexPatternhelper, both Debug and Release.All 8 verification runs pass locally (4 unit + 2x Debug/Release acceptance).
Dependency
This PR is stacked on #54501 because the new unit tests depend on the
CapturingConsolehelper introduced there. Targeting that branch; will rebase tomainonce #54501 merges.