Skip to content

[tests] Truncate command output in DotNet.ExecuteCommand failure messages - #26188

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/fictional-pancake
Jul 22, 2026
Merged

rolfbjarne merged 2 commits into
mainfrom
dev/rolf/fictional-pancake

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

DotNet.ExecuteCommand (used by DotNet.GetProperty/GetItems/Get) runs
dotnet build ... -getItem/-getProperty ... -v:diag with diagnostic
verbosity. On failure it appended the entire merged stdout/stderr of the
build to the Assert.Fail message.

That failure message ends up in the NUnit results XML and is rendered
verbatim in the VSDrops HTML report, so a single failing Get* test could
dump a full ~388k-line diagnostic build log into the report. A recent report
had 4 such blocks and ballooned to 151 MB / 1.5M lines.

The full output is still written to the console (which ends up in a separate
log file), but the failure message now only includes the last 100 lines via
a new GetLastLines helper. This mirrors the sibling DotNet.Execute path,
which already limits itself to the first 10 binlog errors.

🤖 Pull request created by Copilot

…ages

DotNet.ExecuteCommand (used by DotNet.GetProperty/GetItems/Get) runs
`dotnet build ... -getItem/-getProperty ... -v:diag` with diagnostic
verbosity. On failure it appended the entire merged stdout/stderr of the
build to the Assert.Fail message. That message ends up in the NUnit
results XML and is rendered verbatim in the VSDrops HTML report, so a
single failing Get* test could dump a full ~388k-line diagnostic build
log into the report. A recent report had 4 such blocks and ballooned to
151 MB / 1.5M lines.

The full output is still written to the console (which ends up in a
separate log file), but the failure message now only includes the last
100 lines via a new GetLastLines helper. This mirrors the sibling
DotNet.Execute path, which already limits itself to the first 10 binlog
errors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a0176644-3e15-4852-b28d-3b91c400b637
@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the tests/common dotnet command helper to prevent NUnit failure messages (and downstream HTML reports) from embedding extremely large diagnostic build logs when DotNet.ExecuteCommand fails.

Changes:

  • On DotNet.ExecuteCommand failure, write the full merged output to the console log instead of embedding it in the assertion message.
  • Add a GetLastLines helper and include only the last 100 lines of output in the Assert.Fail message.

Comment thread tests/common/DotNet.cs Resolved
@vs-mobiletools-engineering-service2

This comment has been minimized.

…rectly

Address review feedback: instead of building the full merged output string
and then splitting it back into lines to grab the last few, expose the lines
ExecutionOutput already stores via a new MergedOutputLines property, and use
that directly in DotNet.ExecuteCommand's failure path.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a0176644-3e15-4852-b28d-3b91c400b637
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: fc3b9163c9b6de1eee35029949ae395174253e51 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #fc3b916] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 203 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: fc3b9163c9b6de1eee35029949ae395174253e51 [PR build]

@rolfbjarne
rolfbjarne merged commit eab56ba into main Jul 22, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/fictional-pancake branch July 22, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants