Repository navigation
Honor verbosity for informational messages in MSBuildLogger - #16796
Merged
Azat Mukhametshin (azat-msft) merged 2 commits intoDec 3, 2026
Merged
Azat Mukhametshin (azat-msft) merged 2 commits into
Azat Mukhametshin (azat-msft) merged 2 commits into
Conversation
MSBuildLogger ignored the Verbosity parameter that VSTestTask2 passes, so informational test run messages were always shown when dotnet test used the terminal logger. Drop them at quiet and minimal, like ConsoleLogger. Fixes microsoft#16728 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…y filtering Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the terminal-logger verbosity changes.
No open issues 🎉
What changed in this PR
Aligns informational output on the terminal-logger path with ConsoleLogger, addressing #16728 without changing warning or error handling.
Changes:
- Makes
MSBuildLoggerhonor verbosity, suppressing informational messages atquietandminimalwhile preserving forwarding when verbosity is omitted. - Adds unit and acceptance coverage for filtering and normal-verbosity output.
- Configures the test asset to emit an informational parallelization message with one worker.
| File | Description |
|---|---|
test/vstest.console.UnitTests/Internal/MSBuildLoggerTests.cs |
Tests verbosity filtering, default behavior, and preservation of warnings and errors. |
test/TestAssets/TerminalLoggerTestProject/UnitTest1.cs |
Enables single-worker parallelization to produce an informational message. |
test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestMSBuildOutputTests.cs |
Checks terminal-logger output at default and normal verbosity. |
src/vstest.console/Internal/MSBuildLogger.cs |
Parses verbosity and filters informational messages at quiet and minimal levels. |
Review effort: Balanced
Member
Author
|
/azp run microsoft.vstest |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Jan Krivanek (JanKrivanek)
approved these changes
Dec 3, 2026
Azat Mukhametshin (azat-msft)
merged commit Dec 3, 2026
c3f3aec
into
microsoft:main
27 checks passed
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.
Description
When
dotnet testruns with the terminal logger,VSTestTask2starts vstest.console with--logger:Microsoft.TestPlatform.MSBuildLogger;Verbosity=<value>.MSBuildLoggerignored that parameter and forwarded every informational test run message, which the task logs at high importance. So adapter messages such as MSTest's "Test Parallelization enabled for ..." always showed, even at the defaultminimalverbosity. The legacyConsoleLoggerpath hides them.MSBuildLoggernow parsesverbositythe same wayConsoleLoggerdoes and drops informational messages atquietandminimal. Warnings (including xUnit[SKIP]messages) and errors are unchanged. Without a verbosity parameter the logger keeps forwarding everything, as before.Note for reviewers: testhost stdout/stderr that is not captured by a test is also forwarded as informational messages, so at default verbosity it is now hidden on the terminal logger path too. This matches
--tl:off. Users who need it can use-v:n.The
TerminalLoggerTestProjectasset gets[assembly: Parallelize(Workers = 1)]so the new acceptance test has an informational message to check; one worker keeps execution sequential.Related issue
Fixes #16728