Skip to content

Conversation

@fhnaseer
Copy link
Member

@fhnaseer fhnaseer commented May 28, 2025

Fixes #1854

Context

Changes Made

Testing

Notes

@fhnaseer fhnaseer marked this pull request as ready for review October 1, 2025 07:29
@fhnaseer fhnaseer requested a review from a team as a code owner October 1, 2025 07:29
Copilot AI review requested due to automatic review settings October 1, 2025 07:29
Copy link
Contributor

Copilot AI left a comment

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 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

@fhnaseer fhnaseer marked this pull request as draft October 1, 2025 10:52
@fhnaseer fhnaseer marked this pull request as ready for review October 1, 2025 12:18
@YuliiaKovalova YuliiaKovalova changed the title Enabling code coverage Enabling code coverage for Linux/Mac Oct 6, 2025
@YuliiaKovalova YuliiaKovalova changed the title Enabling code coverage for Linux/Mac Enable code coverage for Linux/Mac Oct 7, 2025
@YuliiaKovalova YuliiaKovalova merged commit 044c796 into dotnet:main Oct 7, 2025
10 checks passed
@YuliiaKovalova
Copy link
Member

for the record

coverage for windows is quite flaky, sometimes it will finish in 50 minutes but then sometimes it will stuck forever,
so i disabled coverage for it for now, maybe we can fix it later,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report test coverage

4 participants