PavanMudigonda / jacoco-reporter

GitHub Action to Publish JaCoCo Format Code Coverage XML and attach it to the Workflow Run as a Check Run. Also can enforce Coverage Quality Gate.
https://linkedin.com/in/PavanMudigonda
MIT License
69 stars 7 forks source link

fail_below_threshold is not working correctly #1

Closed PhilippPelchmann closed 2 years ago

PhilippPelchmann commented 2 years ago

Describe the bug Fail below threshold is not working as expected - step fails, even if the threshold is below the code coverage for version 2.3

Additional context The fix is in action.ps1 the variable coverage_value already holds the correct coverage percentage.

current version:

if ($coverage_value.coveragePercentage -lt $inputs.minimum_coverage -and $inputs.fail_below_threshold -eq "true") {
        $script:stepShouldFail = $true
    }

correct:

if ($coverage_value -lt $inputs.minimum_coverage -and $inputs.fail_below_threshold -eq "true") {
        $script:stepShouldFail = $true
    }
markus-arndt-senacor commented 2 years ago

Same issue here

PavanMudigonda commented 2 years ago

Will fix it. Thanks for reporting

PavanMudigonda commented 2 years ago

Fixed. Please verify if its working fine now ! Thanks Philipp and Markus. Please use v2.4

PavanMudigonda commented 2 years ago

@markus-arndt-senacor @PhilippPelchmann Please hit the star icon at top if you liked my GH Action. Appreciate your support in reporting and fixing issue.

PhilippPelchmann commented 2 years ago

@PavanMudigonda thank you for the fixing it so quickly - working as expected now!