Skip to content

ci: publish Azure Pipelines code coverage - #10842

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-publish-code-coverage
Aug 26, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-publish-code-coverage

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

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 ContinuousIntegrationBuild semantics. Deterministic reports preserve /_/ source paths while the existing source filters keep measurement scoped to repository code under src/.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings August 26, 2026 19:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 distinct coverage-{suite}-{framework}.cobertura.xml reports 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 ContinuousIntegrationBuild behavior 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

@ReubenBond
ReubenBond merged commit 2a6404d into dotnet:main Aug 26, 2026
75 checks passed
@ReubenBond
ReubenBond deleted the rb-publish-code-coverage branch August 26, 2026 19:52
This was referenced Aug 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants