Jacoco coverage is showing zero line coverage for a specific java package

1,748 views
Skip to first unread message

Anirban Bhattacharya

unread,
Feb 10, 2021, 7:15:12 AM2/10/21
to JaCoCo and EclEmma Users
Jacoco coverage is showing zero line coverage for a specific java package.
I am using apache beam java SDK along with JDK.
attaching the pom.xml and also jacoco.xml report for your reference.

I am using sonarqube for code coverage. Since jacoco coverage is not properly working so sonarqube is showing 0 line coverage for this specific package.

Let me know any inputs or suggestion. I have tried multiple ways but nothing worked.
jacoco.xml
pom.xml

Marc Hoffmann

unread,
Feb 10, 2021, 8:06:39 AM2/10/21
to JaCoCo and EclEmma Users
Hi,

please check with the Sonarqube project project for this. This integration is not maintained by us, see:


Regards,
-marc


--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/3e920b15-1429-4f21-9118-0ce4e9afd342n%40googlegroups.com.
<jacoco.xml><pom.xml>

Marc Hoffmann

unread,
Feb 10, 2021, 8:27:25 AM2/10/21
to JaCoCo and EclEmma Users
I have to correct myself: As coverage is already zero in jacoco.xml there is a problem with the test setup.

Do you also generate the JaCoCo HTML report? It has a link “sessions” on the top right corner. Are the classes you’re looking for listed in that page?

Regards,
-marc

Anirban Bhattacharya

unread,
Feb 10, 2021, 12:42:50 PM2/10/21
to JaCoCo and EclEmma Users
Hi Marc,

Yes I saw the html report. I see the file IngestionPipeline.java is not listed whereas IngestionPipelineTest.java is listed. All other packages are having *.java and *Test.java both in the html report whereas for this specific package *.java is not covered whereas *Test.java is covered. Its strange. This IngestionPipeline.java is a class implemented using apache beam java SDK API/library.

Does jacoco support other API/library except normal JDK ?

Thanks,
Anirban

Anirban Bhattacharya

unread,
Feb 11, 2021, 3:25:05 AM2/11/21
to JaCoCo and EclEmma Users
Hi Marc,

Is it possible to go for a short meeting where I can screen share and can show you the issue. May be I am missing something in pom.xml.
Not sure. Did you check my pom.xml? 

Thanks,
Anirban

On Wednesday, February 10, 2021 at 2:27:25 PM UTC+1 Marc R. Hoffmann wrote:

Marc Hoffmann

unread,
Feb 11, 2021, 4:41:30 AM2/11/21
to JaCoCo and EclEmma Users
Hi Anirban,

please understand that we provide free support only through open channels.

If the classes under test are not listed on the sessions page this can have a couple of reasons:

1) You defined a filter to exclude them
2) The classes have not been executed
3) The classes have been executed in a different Java VM then the one where you attached the agent

In your case it might be 3). If I have a look at the documentation it looks like Apache Bean uses separate worker processes:


In this case you will need to also configure JaCoCo agent for the worker processes.

Regards,
-matc


Do you know how the Apache Beam framework works? Does it start other VMs for the actual processing?

Reply all
Reply to author
Forward
Message has been deleted
0 new messages