Enable code coverage for Linux/Mac#11920
Merged
YuliiaKovalova merged 95 commits intodotnet:mainfrom Oct 7, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive code coverage collection for the MSBuild repository by configuring the test infrastructure to use VSTest runner with Microsoft.CodeCoverage data collector instead of the previous xUnit runner.
Key changes include:
- Switching from xUnit to VSTest runner with code coverage enabled
- Adding runsettings files to configure coverage collection for different platforms
- Creating PowerShell and Bash scripts to process and merge coverage reports
- Updating CI pipeline to collect, process, and publish coverage artifacts from all build jobs
- Adding test isolation improvements to prevent cross-test interference
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/Directory.Build.targets |
Switches test runner from xUnit to VSTest with coverage settings and filters |
src/Directory.Build.props |
Enables VSTest runner for test projects |
CoverageWindowsFull.runsettings |
Configures code coverage collection for Windows with specific module filters |
Coverage.runsettings |
Configures basic code coverage collection for non-Windows platforms |
.vsts-dotnet-ci.yml |
Updates CI pipeline to collect, process and publish coverage reports |
eng/process-coverage.ps1 |
PowerShell script to merge coverage reports using dotnet-coverage tool |
eng/process-coverage.sh |
Bash script equivalent for Unix platforms |
eng/restore-dotnet-coverage.ps1 |
PowerShell script to install dotnet-coverage tool |
eng/restore-dotnet-coverage.sh |
Bash script equivalent for Unix platforms |
| Various test files | Adds test isolation and timeout improvements |
YuliiaKovalova
approved these changes
Oct 2, 2025
Comment out the code coverage task in multiple sections due to instability.
Skip a test case due to a floating failure that needs investigation.
Member
|
for the record |
This was referenced Feb 23, 2026
Merged
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.
Fixes #1854
Context
Changes Made
Testing
Notes