chocolatey / Chocolatey.Cake.Recipe

A set of convention based Cake scripts for building Chocolatey projects
Apache License 2.0
5 stars 9 forks source link

Coverlet is not used to calculate unit test coverage when project is configured to use it #124

Closed gep13 closed 10 months ago

gep13 commented 10 months ago

Checklist

What You Are Seeing?

When running the build.bat on a project that is configured to use Coverlet (via the inclusion of the Coverlet NuGet package) Coverlet is not being used, but instead OpenCover is being used. This should not happen.

The problem here is that an invalid check for IsNetCore() is being used, which mean that usage of Coverlet is never allowed. There is a known issue with the IsNetCore() method, where is doesn't correctly detect anything above .NET 5.0, and shouldn't be used.

What is Expected?

When a project is configured to use Coverlet via the NuGet package, unit test coverage should be executed via Coverlet, rather then OpenCover.

How Did You Get This To Happen?

  1. Run a build on a project that is using Coverlet (specifically one that is using .NET Core)
  2. See that the Install-OpenCover task is run, and that it is used to calculate the Test Coverage

System Details

Installed Packages

N/A

Output Log

N/A

Additional Context

N/A

choco-bot commented 10 months ago

:tada: This issue has been resolved in version 0.24.2 :tada:

The release is available on:

Your GitReleaseManager bot :package::rocket: