Skip to content

ci: wire coverlet code coverage into CI with artifact upload#195

Merged
NichUK merged 2 commits into
mainfrom
copilot/repo-assist-eng-add-code-coverage-collection-to-ci
Jun 18, 2026
Merged

ci: wire coverlet code coverage into CI with artifact upload#195
NichUK merged 2 commits into
mainfrom
copilot/repo-assist-eng-add-code-coverage-collection-to-ci

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

coverlet.collector and coverlet.msbuild were already present in the test project but never activated in CI. This wires them up so coverage data is collected and uploaded on every build.

Changes

  • .github/workflows/ci.yml: adds --collect "XPlat Code Coverage" --settings tests/coverlet.runsettings to the dotnet test step; adds a second artifact upload step for coverage.cobertura.xml
  • tests/coverlet.runsettings (new): scopes collection to [FixedPointNano]*, excludes the test assembly and GeneratedCodeAttribute/CompilerGeneratedAttribute, outputs Cobertura format with source-link enabled

Copilot AI changed the title [WIP] Add code coverage collection to CI workflow ci: wire coverlet code coverage into CI with artifact upload Jun 18, 2026
Copilot AI requested a review from NichUK June 18, 2026 18:48
@NichUK NichUK marked this pull request as ready for review June 18, 2026 18:59
Copilot AI review requested due to automatic review settings June 18, 2026 18:59
@NichUK NichUK merged commit 6181053 into main Jun 18, 2026
18 checks passed
@NichUK NichUK deleted the copilot/repo-assist-eng-add-code-coverage-collection-to-ci branch June 18, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown

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 wires Coverlet’s XPlat Code Coverage data collector into the CI pipeline so test runs automatically generate Cobertura coverage output and upload it as a workflow artifact.

Changes:

  • Add --collect "XPlat Code Coverage" --settings tests/coverlet.runsettings to the CI dotnet test step so coverage is produced during test execution.
  • Upload TestResults/**/coverage.cobertura.xml as a dedicated CI artifact.
  • Introduce tests/coverlet.runsettings to scope and configure coverage collection/output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/ci.yml Enables XPlat coverage collection during CI test runs and uploads the Cobertura report artifact.
tests/coverlet.runsettings Defines Coverlet collector settings (include/exclude filters, attributes, Cobertura format, SourceLink).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines 33 to 37
run: dotnet build -c Release --no-restore

- name: Run tests
run: dotnet test -c Release --no-build --logger "trx;LogFileName=test-results.trx" --results-directory TestResults
run: dotnet test -c Release --no-build --logger "trx;LogFileName=test-results.trx" --results-directory TestResults --collect "XPlat Code Coverage" --settings tests/coverlet.runsettings

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.

3 participants