unable to get IT code coverage using jacoco

474 views
Skip to first unread message

sripri...@gmail.com

unread,
Nov 25, 2014, 3:23:55 AM11/25/14
to jac...@googlegroups.com
Hi Team,

We are not able to get IT code coverage using Jacoco.

IT coverage is shown as 0.0% in sonar dashboard.

As a first step we have generated jacoco-it.exec file and executed the below command to get the coverage on sonar dashboard.

mvn -Dsonar.jacoco.itReportPath="E:\BuildAgent\work\b8f0a63c1c75b440\services\branches\phase_1_iteration_3\target\jacoco-it.exec" sonar:sonar -Dsonar.dynamicAnalysis=reuseReports


Please note that it is a multi module project and we need IT coverage for a particular module.

Kindly help us in resolving this issue and let me know if any further information is needed.

Thanks,
Sri Priyanka

sri priyanka

unread,
Nov 25, 2014, 4:05:38 AM11/25/14
to jac...@googlegroups.com
I am attaching the pom.xml that we have used to generate jacoco-it.exec and also the index.html file generated after executing the above command(sonar step).


--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/3VzuqP4EHTs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/41285386-475f-4ec1-b925-e3969fc4d503%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pom.xml
index.html screen shot.PNG

Marc Hoffmann

unread,
Nov 25, 2014, 9:50:26 AM11/25/14
to jac...@googlegroups.com
Have you performed the checks described in the FAQ? What are your
observations?

http://www.eclemma.org/jacoco/trunk/doc/faq.html


Q: Why does a class show as not covered although it has been executed?

A: First make sure execution data has been collected. For this select
the Sessions link on the top right corner of the HTML report and check
whether the class in question is listed. If it is listed but not linked
the class at execution time is a different class file. Make sure you're
using the exact same class file at runtime as for report generation.
Note that some tools (e.g. EJB containers, mocking frameworks) might
modify your class files at runtime. Please see the chapter about class
ids for a detailed discussion.


Best regards,
-marc



On 2014-11-25 10:05, sri priyanka wrote:
> I am attaching the pom.xml that we have used to generate
> jacoco-it.exec and also the index.html file generated after executing
> the above command(sonar step).
>
> On Tue, Nov 25, 2014 at 1:53 PM, <sripri...@gmail.com> wrote:
>
>> Hi Team,
>>
>> We are not able to get IT code coverage using Jacoco.
>>
>> IT coverage is shown as 0.0% in sonar dashboard.
>>
>> As a first step we have generated jacoco-it.exec file and executed
>> the below command to get the coverage on sonar dashboard.
>>
>> mvn
>>
> -Dsonar.jacoco.itReportPath="E:BuildAgentworkb8f0a63c1c75b440servicesbranchesphase_1_iteration_3targetjacoco-it.exec"
>> sonar:sonar -Dsonar.dynamicAnalysis=reuseReports
>>
>> Please note that it is a multi module project and we need IT
>> coverage for a particular module.
>>
>> Kindly help us in resolving this issue and let me know if any
>> further information is needed.
>>
>> Thanks,
>> Sri Priyanka
>>
>> --
>> You received this message because you are subscribed to a topic in
>> the Google Groups "JaCoCo and EclEmma Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jacoco/3VzuqP4EHTs/unsubscribe
>> [1].
>> To unsubscribe from this group and all its topics, send an email to
>> jacoco+un...@googlegroups.com.
>> To view this discussion on the web visit
>>
> https://groups.google.com/d/msgid/jacoco/41285386-475f-4ec1-b925-e3969fc4d503%40googlegroups.com
>> [2].
>> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> 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/CANbHXxAvgpAoEjufaOO3Kvqdr3jK4Ld-x%2BxtJKAf6uOOaVB_vQ%40mail.gmail.com
> [4].
> For more options, visit https://groups.google.com/d/optout [3].
>
>
> Links:
> ------
> [1] https://groups.google.com/d/topic/jacoco/3VzuqP4EHTs/unsubscribe
> [2]
> https://groups.google.com/d/msgid/jacoco/41285386-475f-4ec1-b925-e3969fc4d503%40googlegroups.com
> [3] https://groups.google.com/d/optout
> [4]
> https://groups.google.com/d/msgid/jacoco/CANbHXxAvgpAoEjufaOO3Kvqdr3jK4Ld-x%2BxtJKAf6uOOaVB_vQ%40mail.gmail.com?utm_medium=email&utm_source=footer

srava...@gmail.com

unread,
Nov 26, 2014, 12:47:30 AM11/26/14
to jac...@googlegroups.com
Hi Marc,

Thanks for the explaination.

When i see the sessions link in the HTML report generated it lists down only the integration tests classes with the ids that got executed,but i didn't get the code coverage for the integration tests.

Coming to in detailed information of integration tests these will be make use of the JBoss container for execution and in built h2 database for data setup for execution of integration tests.

Thanks,
Sravan Kumar Indupuri

Marc R. Hoffmann

unread,
Nov 26, 2014, 12:27:07 PM11/26/14
to jac...@googlegroups.com
Hi Sravan,

you need to make sure that you configure the JaCoCo agent for the JVM
where your classes under test are actually executed, in your case the
JBoss container.

Regards,
-marc

sravankumar indupuri

unread,
Nov 26, 2014, 11:14:22 PM11/26/14
to jac...@googlegroups.com, Marc R. Hoffmann

Hi Marc,


I have configured the JaCoCo agent for the JVM where your classes under test are actually executed.


PFA Plugins_Services and Plugins_Jacoco for the plugins I have configured in the pom.xml for the maven sure fire, maven fail safe and jacoco maven plugin.

 

I have configured the jacoco agent pointing during run time before execution of integration tests in the maven fail safe plugin in the following way:


 <configuration>
       <!-- Sets the VM argument line used when integration tests are run. -->
       <argLine>${failsafeArgLine}</argLine>
  </configuration>


But as the reports generated for Junit test cases as well as integration tests I am able to figure out a small difference:


1. For the HTML report generated for the Junit test cases I am able to see the java classes which were executed while execution of java test classes but not able to see the Test java classes.


2.For the HTML report generated for the Integration test cases I am not able to see the java classes which were executed while execution of java test classes but able to see the Test java classes.


Please let me know your suggestions.


Thanks,

Sravan Kumar



To view this discussion on the web visit

https://groups.google.com/d/msgid/jacoco/41285386-475f-4ec1-b925-e3969fc4d503%40googlegroups.com
[2].
For more options, visit https://groups.google.com/d/optout [3].
  --
  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,
--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/3VzuqP4EHTs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/54760D6C.3070102%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Plugins_Jacoco.txt
Plugins_Services.txt

sravankumar indupuri

unread,
Nov 28, 2014, 1:54:32 AM11/28/14
to jac...@googlegroups.com, hoff...@mountainminds.com
Hi Marc,

As suggested i have tested configuring the VM Parameter for MAVEN_OPTS as 

setx MAVEN_OPTS "-Xmx512m -XX:MaxPermSize=128m -verbose" and ran the build using mvn clean install -Parq-jboss-remote where arq-jboss-remote is the profile configured for running intergration test cases(Arquillian test cases).

I am able to see the see the classes loaded from jdk, apaven maven and test classes (Junits and integration tests) required for the build , but not able to see the tested classes for JUnit as well as Integration tests.

Thanks,
Sravan Kumar

sri priyanka

unread,
Dec 2, 2014, 2:51:57 AM12/2/14
to jac...@googlegroups.com, hoff...@mountainminds.com
Hi Marc,
Kindly provide your feedback on Sravan's observations.
Thanks,
Sri Priyanka

To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/691ac4b8-946b-470d-ac1b-6d296f1e4679%40googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages