Add -NoCoverage switch and improve crash diagnostics - #548
Conversation
Adds a -NoCoverage switch to dotnet-test-cloud.ps1 for both the MTP and VSTest code paths. Code coverage instrumentation can destabilize a test run, and when it does there is currently no way for a repo to keep running tests on the affected leg without hand-editing this script. Also collect a crash report alongside the crash dump, and restrict the dump to the heap. On Linux the native crash report is often the only way to identify the faulting thread and instruction when a test host dies of an access violation, and a heap dump is considerably smaller than the default full dump while still containing everything needed to analyze managed state. Finally, stop discarding crash dumps that have no TRX attachment copy. The previous filter kept a .dmp only when it appeared under a TRX 'In' directory, so on GitHub Actions -- which does not request a TRX report -- every crash dump was dropped from the uploaded artifacts, making test host crashes impossible to diagnose. The dumps are now de-duplicated by file name instead, which still avoids uploading the same dump twice on Azure Pipelines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #548 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 2 2
=========================================
Hits 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR enhances the repository’s cloud-test orchestration scripts to make CI test runs more resilient and diagnosable by allowing coverage to be disabled on demand and by improving crash dump collection/upload behavior.
Changes:
- Added a
-NoCoverageswitch totools/dotnet-test-cloud.ps1for both Microsoft.Testing.Platform (MTP) and VSTest execution paths. - Improved MTP crash diagnostics by collecting a native crash report (when supported) and restricting crash dumps to heap dumps to reduce artifact size.
- Updated test result artifact selection to avoid dropping crash dumps when no TRX attachment copy exists, while still deduplicating duplicate dumps when TRX attachments are present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/dotnet-test-cloud.ps1 | Adds -NoCoverage and improves MTP crash dump/report configuration (heap dumps + native crash report). |
| tools/artifacts/testResults.ps1 | Adjusts dump selection to keep non-TRX-attached dumps (e.g., GH Actions), while deduplicating by dump filename when TRX attachments exist. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adds a -NoCoverage switch to dotnet-test-cloud.ps1 for both the MTP and
VSTest code paths. Code coverage instrumentation can destabilize a test
run, and when it does there is currently no way for a repo to keep running
tests on the affected leg without hand-editing this script.
Also collect a crash report alongside the crash dump, and restrict the dump
to the heap. On Linux the native crash report is often the only way to
identify the faulting thread and instruction when a test host dies of an
access violation, and a heap dump is considerably smaller than the default
full dump while still containing everything needed to analyze managed state.
Finally, stop discarding crash dumps that have no TRX attachment copy. The
previous filter kept a .dmp only when it appeared under a TRX 'In'
directory, so on GitHub Actions -- which does not request a TRX report --
every crash dump was dropped from the uploaded artifacts, making test host
crashes impossible to diagnose. The dumps are now de-duplicated by file
name instead, which still avoids uploading the same dump twice on Azure
Pipelines.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com