Repository navigation
Emit Azure DevOps logging commands at column 0 from the MSBuild test runner - #9895
Merged
Amaury Levé (Evangelink) merged 2 commits intoJul 13, 2026
Merged
Conversation
The AzureDevOpsReport extension writes ##[group]/##[endgroup]/##vso[...] commands at column 0 on the test host stdout. The MSBuild InvokeTestingPlatformTask captured that stdout and re-emitted it via Log.LogMessage, which the MSBuild console logger indents by 2 spaces. Azure Pipelines only honors logging commands that start at column 0, so the log groups stopped collapsing and the markers rendered as garbled text (e.g. 'oup]Tests:'). Route Azure DevOps command lines straight to Console.Out (column 0) instead of through the indenting MSBuild logger; all other output is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e7a0af3b-eb61-4740-8da4-9890d0468cc9
Contributor
There was a problem hiding this comment.
Pull request overview
Routes Azure DevOps logging commands directly to stdout so MSBuild does not indent and invalidate them.
Changes:
- Detects Azure DevOps command lines and preserves column-zero output.
- Adds classifier and routing unit tests.
Show a summary per file
| File | Description |
|---|---|
InvokeTestingPlatformTask.Execution.cs |
Routes Azure DevOps commands directly to stdout. |
InvokeTestingPlatformTaskTests.cs |
Tests command classification and output routing. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Medium
The routing test replaces process-wide Console.Out; this project runs method-level parallel tests, so isolate it to avoid capturing another test's output or racing on Console.Out restoration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e7a0af3b-eb61-4740-8da4-9890d0468cc9
Contributor
🧪 Test quality grade — PR #9895
This advisory comment was generated automatically. Grades are heuristic and informational — they do not block merging. Re-run with Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Amaury Levé (Evangelink)
enabled auto-merge (squash)
July 13, 2026 12:27
Petr Pokorny (0101)
approved these changes
Jul 13, 2026
Amaury Levé (Evangelink)
deleted the
dev/amauryleve/fix-azdo-test-grouping
branch
July 13, 2026 12:37
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.
What
Fixes the broken Azure DevOps log-grouping feature when running tests through the MSBuild runner (
dotnet test/dotnet build -t:TestwithTestingPlatformCaptureOutput=false).Symptoms reported (see e.g. this build):
oup]Tests: Microsoft.Testing.Extensions.VSTestBridge.UnitTests (net8.0).Root cause
Both symptoms are the same bug — the
##[group]command lines are indented, so the Azure Pipelines agent stops recognizing them.##[group]Tests: …at column 0 to its own stdout (viaMicrosoft.Testing.Extensions.AzureDevOpsReport).InvokeTestingPlatformTask(aToolTask) captures that stdout and re-emits every line throughLog.LogMessage(High, …)inLogEventsFromTextOutput.##[group]Tests: ….##[group],##[endgroup],##vso[...]) when they start at column 0 (no trimming). Indented ⇒ no collapse, and the AzDO web UI renders the unrecognized marker as garbled text.Fix
In
InvokeTestingPlatformTask.LogEventsFromTextOutput, route Azure DevOps command lines (starting with##[or##vso[) straight toConsole.Out(column 0) instead of the indentingLog.LogMessage. All other output keeps flowing through MSBuild logging unchanged.Each assembly's
##[group](session start) and##[endgroup](session end) run through the same task instance on the same node, so markers stay matched.Tests
IsAzureDevOpsLoggingCommandclassifier data rows (commands vs. regular/indented output).All 20 unit tests in
Microsoft.Testing.Platform.MSBuild.UnitTestspass; build is warning-free.Known limitation (follow-up)
Under multi-node
dotnet test(-m), a task'sConsole.Outis only delivered from the in-proc node — worker-node console output is dropped by MSBuild. So after this change:Making grouping fully correct under parallel, interleaved
dotnet testneeds per-assembly output serialization/buffering; I'll follow up with an exploration/issue.