ci: publish Azure Pipelines code coverage - #10842
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end code coverage publication for Azure Pipelines test runs by reusing the existing GitHub Actions coverage scripts/config, producing per-suite/per-framework Cobertura reports, preserving them as pipeline artifacts, and publishing the aggregated result via PublishCodeCoverageResults@2 so the Azure DevOps Code Coverage tab is populated.
Changes:
- Collect coverage in each Azure Pipelines test job via
setup-coverage.ps1+invoke-coverage.ps1, outputting distinctcoverage-{suite}-{framework}.cobertura.xmlreports to job artifacts. - Add a dedicated Azure Pipelines job to download all Cobertura artifacts and publish aggregated coverage results (failing if empty).
- Align CI semantics and report determinism across GitHub and Azure by preserving
ContinuousIntegrationBuildbehavior and enabling deterministic reports in shared coverage configs.
Show a summary per file
| File | Description |
|---|---|
| .github/scripts/test-summarize-coverage.ps1 | Extends CI validation to assert Azure Pipelines coverage collection/version pinning and deterministic coverage configuration. |
| .github/scripts/setup-coverage.ps1 | Supports non-GitHub CI by allowing an explicit tool install path and only appending to GITHUB_PATH when present. |
| .github/coverage.static.config.xml | Enables deterministic report paths and adjusts assembly-without-sources handling for static instrumentation. |
| .github/coverage.config.xml | Enables deterministic report paths and adjusts assembly-without-sources handling for dynamic instrumentation. |
| .github/actions/dotnet-test/action.yml | Removes forced ContinuousIntegrationBuild=false so GitHub coverage retains normal CI build semantics. |
| .azure/pipelines/templates/vars.yaml | Pins DOTNET_COVERAGE_VERSION for Azure Pipelines to match GitHub’s coverage tool versioning approach. |
| .azure/pipelines/templates/build.yaml | Collects and archives Cobertura per test job, then downloads and publishes aggregated coverage via PublishCodeCoverageResults@2. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
This was referenced Aug 28, 2026
Merged
Merged
This was referenced Sep 4, 2026
This was referenced Sep 9, 2026
Closed
Closed
This was referenced Sep 16, 2026
Open
Merged
This was referenced Sep 23, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Azure DevOps test runs currently produce test results without publishing coverage, leaving the Code Coverage tab empty.
This change collects a distinct Cobertura report from every suite/framework test job, preserves those reports as pipeline artifacts, and publishes their aggregate through
PublishCodeCoverageResults@2. Azure and GitHub share the same coverage setup, collection scripts, and configuration.Coverage retains normal
ContinuousIntegrationBuildsemantics. Deterministic reports preserve/_/source paths while the existing source filters keep measurement scoped to repository code undersrc/.Microsoft Reviewers: Open in CodeFlow