Repository navigation
[tests] Truncate command output in DotNet.ExecuteCommand failure messages - #26188
Conversation
…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
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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.ExecuteCommandfailure, write the full merged output to the console log instead of embedding it in the assertion message. - Add a
GetLastLineshelper and include only the last 100 lines of output in theAssert.Failmessage.
This comment has been minimized.
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
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
DotNet.ExecuteCommand(used byDotNet.GetProperty/GetItems/Get) runsdotnet build ... -getItem/-getProperty ... -v:diagwith diagnosticverbosity. On failure it appended the entire merged stdout/stderr of the
build to the
Assert.Failmessage.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 coulddump 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
GetLastLineshelper. This mirrors the siblingDotNet.Executepath,which already limits itself to the first 10 binlog errors.
🤖 Pull request created by Copilot