Skip to content

Code coverage results are not visible in PRs or build summaries #7553

@gavinbarron

Description

@gavinbarron

Problem

Currently, code coverage data is collected during CI builds but the results are not surfaced where developers can easily see them:

  • GitHub Actions (dotnet.yml): Coverage is collected and a report is generated, but it is only uploaded as a build artifact. Developers must download and extract the artifact to view results. There is no coverage summary in the PR or job summary.
  • Azure DevOps (ci-build.yml): The test step does not collect code coverage at all, so no coverage data is available in the build or PR.

Impact

Without visible coverage results, developers cannot quickly assess whether a PR maintains or improves test coverage. This reduces the effectiveness of code review and makes it harder to catch coverage regressions.

Proposed Solution

  1. GitHub Actions: Add MarkdownSummaryGithub report type to ReportGenerator, write the summary to \, and post it as a sticky PR comment using marocchino/sticky-pull-request-comment.
  2. Azure DevOps: Add --collect:"XPlat Code Coverage" to the test step, install and run ReportGenerator to merge coverage files, and publish results using the PublishCodeCoverageResults@2 task so coverage appears in the build's Code Coverage tab and PR diffs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions