[Query] Android-Gradle code coverage

54 views
Skip to first unread message

Arihant Jain

unread,
Mar 1, 2019, 12:11:06 PM3/1/19
to jac...@googlegroups.com
Hi Team, I am an adobe engg. I was trying to integrate jacoco into gradle android project and have some queries for which I am hoping will receive an answer or direction to help me resolve them

Code Structure of our application is as following:

At present, our internal android application is multi module. We have written UI test for the complete application but are located in one centre module rather in their specific modules and all Unit test are located in their respective modules. 

Problem: 
  1. However after execution of connectedDebugAndroidTestCoverageReport, execution data (.ec file) only generates for our centre module where the UI tests are located and does not generate for other modules.
  2. I believe this could be achieved with using offline instrumentation but after referring to many documents I am unable to find how to use jacocoAgent-offline instrumentation with gradle. Need a hand there here.
Regards
Arihant jain

arih...@adobe.com

unread,
Mar 5, 2019, 12:01:42 AM3/5/19
to JaCoCo and EclEmma Users
Any update on this item? Let me reiterate the problem:

After execution of instrumentation UI test on android, the execution detail gets generated only for one central module and when I generate the report I see 0% code coverage  for the classes for which UI test ran. What should I do to get correct code coverage?

Marc Hoffmann

unread,
Mar 5, 2019, 1:39:35 AM3/5/19
to jac...@googlegroups.com
Hi Arihant,

please be aware that neither the Grade nor the Android implementation is developed by the JaCoCo team. You might find some help at these projects. They maintain their JaCoCo integrations themself. AFAIK Android SDK uses offline instrumentation as their runtime does not support Java agents.

The only general advice I can give is to check the “Sessions” page of the JaCoCo project for the classes with code coverage missing:

Case 1: The classes are not listed —> They have not been executed or were not seen bei the JaCoCo runtime
Case 2: The classes are listed —> A different version of the class was used at runtime than at report generation time

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/0aa44e88-f64b-4aaf-8d16-40c3c266889f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages