Skip to content

Conversation

@Bertk
Copy link
Collaborator

@Bertk Bertk commented Jan 8, 2026

This pull request updates the project's test coverage reporting format from OpenCover to Cobertura and makes several related adjustments to the build and reporting scripts. It also removes a legacy test script and expands the build and packaging steps for better cross-platform compatibility and package creation.

Key changes include:

Test Coverage Format and Reporting:

  • Switched all test coverage output in eng/build.yml from OpenCover to Cobertura, and updated the coverage report publishing step and assembly filters accordingly. [1] [2]
  • Added a new scripts/report.sh script to generate coverage reports using the Cobertura format and updated filters, replacing the previous OpenCover-based approach.

Build and Packaging Improvements:

  • Refactored and expanded the build script (now scripts/build.sh, renamed from eng/build.sh) to:
    • Remove the ContinuousIntegrationBuild=true property from most build and pack commands.
    • Add explicit steps for creating NuGet packages in both Debug and Release configurations for all relevant projects.
    • Adjust test project build steps to skip building coverlet.core.coverage.tests on Linux due to compatibility issues.
    • Fix the binlog file name for .NET 9 test builds.
    • Clean up all .binlog files across the repository, not just in one directory.

Script and Test Cleanup:

  • Removed the obsolete eng/test.sh script, consolidating test logic into the build process.Updated build pipeline to generate Cobertura coverage reports instead of OpenCover. Adjusted test commands and coverage publishing steps to use the new format. No other pipeline logic was changed.

Assumption: OpenCover generates different results for runs on CI (PR) and master branch.

Overall code line coverage results with OpenCover:
local build -> 88%, lines:974
PR (branch) -> 88%, lines:974
master branch -> 81%, lines:974 (after merge)

Updated build pipeline to generate Cobertura coverage reports instead of OpenCover. Adjusted test commands and coverage publishing steps to use the new format. No other pipeline logic was changed.
@Bertk
Copy link
Collaborator Author

Bertk commented Jan 8, 2026

The CI run also generates cobertura coverage files for integration test deterministic build feature. This shall not be used for the report.

image

ignore assembly coverletsample.integration.determisticbuild
@Bertk Bertk changed the title Switch coverage reports from OpenCover to Cobertura Switch coverage reports format from OpenCover to Cobertura Jan 8, 2026
@Bertk Bertk marked this pull request as ready for review January 8, 2026 18:14
Copilot AI review requested due to automatic review settings January 8, 2026 18:14
Copy link

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 switches the coverage report format from OpenCover to Cobertura in the Azure Pipelines build configuration. The change addresses inconsistent coverage results observed between CI runs on PR branches versus the master branch.

Key changes:

  • Updated all test commands to use /p:CoverletOutputFormat=cobertura instead of opencover
  • Updated coverage report file pattern from *.opencover.xml to *.cobertura.xml
  • Added -coverletsample.integration.determisticbuild to assembly exclusion filters

Bertk added 2 commits January 9, 2026 09:33
Update test scripts to use Cobertura format for coverage reports and
improve result file naming and logging. Add report.sh for generating
coverage reports with ReportGenerator. Enhance build.sh cleanup to
remove all *.binlog files across the workspace.
…e namespace

Refactored build.sh and test.sh to simplify build/test commands,
removing most /p:ContinuousIntegrationBuild=true flags and
explicitly targeting net8.0 for test runs. Updated TestUtils.cs
to use Path.Combine for netstandard2.0 compatibility. Changed
coverlet.tests.utils.csproj to target both netstandard2.0 and
the minimum .NET version, increasing cross-platform support.
@Bertk Bertk merged commit 9f9d6e7 into coverlet-coverage:master Jan 9, 2026
9 of 11 checks passed
@Bertk Bertk deleted the use-cobertura branch January 9, 2026 12:48
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.

1 participant