Madrapps / jacoco-report

Github action that publishes the JaCoCo report as a comment in the Pull Request
https://github.com/marketplace/actions/jacoco-report
MIT License
144 stars 63 forks source link

Incorrect value for `steps.jacoco.outputs.coverage-changed-files` #71

Open alexlambrides opened 11 months ago

alexlambrides commented 11 months ago

The value outputted by the action for steps.jacoco.outputs.coverage-changed-files is different from the value mentioned in the comment. Here is an example comment from my repository:

Code Coverage

Overall Project 30.23% -0.08% :x:
Files changed 77.71% :green_apple:

And for the same action run, this was printed in the debug logs for coverage-changed-files:

##[debug]Set output coverage-changed-files = 34.72

In the jacoco-playground example repository, you can see the same issue for this pull request and action run: https://github.com/thsaravana/jacoco-playground/pull/24#issuecomment-1657229203 https://github.com/thsaravana/jacoco-playground/actions/runs/5707555753/job/15466273007?pr=24#step:8:11

Notice the comment states that the changed files percent is 38.24%, while the action prints out Changed Files coverage 35.25

gokhan-oner commented 11 months ago

I hit the same issue & debugged a bit. It seems its introduced in 1.6. In 1.4, value in the report matches the steps.jacoco.outputs.coverage-changed-files but in newer versions, its incorrect. In some cases, it shows as passing in the report but check fail.

In my case, its more obvious: 1.4 & 1.5 reports 66.2%, 1.6+ reports 100%. So it seems steps.jacoco.outputs.coverage-changed-files is correct my value shown in the label is wrong!