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

Code coverage differs from JaCoCo report #43

Closed opwvhk closed 1 year ago

opwvhk commented 1 year ago

Describe the bug

The code coverage as added to the workflow differs from what JaCoCo reports.

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behaviour:

  1. Add the action to a Java project with interfaces and/or classes that are excluded
  2. Let the workflow run
  3. See the result, e.g.: https://github.com/opwvhk/avro-conversions/actions/runs/5077740253/jobs/9121402487

What we see here is that interfaces, like SimpleContentHandler.java, don't have any details.

Also, excluded classes like FixedXmlSchemaWalker.java mark many lines as missed, whereas this class should not be in the report at all!

Expected behaviour

PavanMudigondaTR commented 1 year ago

Will look in to this in few days.

PavanMudigondaTR commented 1 year ago

@opwvhk

It appears to be problem with https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin

Also I suggest you try to verify syntax of "exclude" in pom.xml . I suggest to review this guide https://www.baeldung.com/jacoco-report-exclude

image

image

opwvhk commented 1 year ago

Thank you; that triggered a change that fixed most of it. Now, I only get crosses for classes without code (pure interfaces). Good enough.