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
76 stars 7 forks source link

Different coverage values between jacoco file and jacoco-reporter #64

Open michalwilk96 opened 8 months ago

michalwilk96 commented 8 months ago

Describe the bug After unit tests execution and performing jacoco-reporter action with jacoco.xml file produced by jacoco plugin, there's a difference between actual coverage produced by your jacoco-reporter action and jacoco html also produced by jacoco plugin along with jacoco.xml.

Expected behavior jacoco-reporter should report the same value of coverage as visible in jacoco html / xml file.

Screenshots I attach screen with visible difference. 45% coverage value is taken from "Missed Instructions" column from jacoco html file. While jacoco-reporter produces 50.73% value.

There's no other coverage value available in this jacoco html file, which equals the one provided in the jacoco-reporter.

image
PavanMudigondaTR commented 8 months ago

@michalwilk96 Could you please review this issue https://github.com/PavanMudigonda/jacoco-reporter/issues/43 as it looks similar which turned out to be not defect on jacoco-reporter gh action.

michalwilk96 commented 8 months ago

Hi @PavanMudigondaTR , I took a look on attached issue, but it's another case. I've generated reported by jacoco, which includes all "production" classes, report shows following values: image

And jacoco-reporter plugin shows: image

michalwilk96 commented 8 months ago

First, I thought that actual coverage is sum of Missed Instructions and Missed Branches, but when I took a look on another jacoco report of my another service, I got actual coverage ~50% in jacoco-reporter, but generated jacoco report contains missed branches = 45% & missed instructions = 25% = 70%.