psake / PowerShellBuild

Common build tasks for psake and Invoke-Build that build and test PowerShell modules
MIT License
134 stars 24 forks source link

Fix for CodeCoverage, Instruction and Line results were always 0.00 #63

Open FLeven opened 2 years ago

FLeven commented 2 years ago

My Build was not completing anymore since I activated the Code Coverage, until I removed "[Math]::Truncate" for the $perc VAR.

I am still able to set and change the threshold for the percentage required to for the build to pass, this should be the solution to the problem.

Motivation and Context

I want to use the code coverage for my projects

How Has This Been Tested?

I changed the code coverage threshold to fail and pass my builds, and finally the numbers compared as excepted.

Screenshots (if appropriate):

Types of changes

Checklist:

FLeven commented 1 year ago

Any chance to get his fix on the psgallery ?

HeyItsGilbert commented 3 weeks ago

@FLeven I'm interested in this, but can you help me understand how it was failing before? Ideally I would want to reproduce the error to confirm the fix in different scenarios.

Which version of PowerShell were you using? In theory Truncate should just round down to the nearest whole number.