Code Coverage issue in Android Automotive Car Emulator

198 views
Skip to first unread message

Keshav Verma

unread,
Feb 27, 2021, 3:50:45 AM2/27/21
to JaCoCo and EclEmma Users

Hi 

Objective is to get 100% code coverage for instrumentation test in Android Automotive Car Emulator API 29.

I am trying to run coverage report on android test(instrumentation test) using jacoco version 0.8.0 till 0.8.6 on Android Automotive Car Emulator API 29, test cases are executing successfully but code coverage is 0% for instrumentation test(espresso test). Generated coverage.ec file is empty in the car emulator. 

I also noticed that code coverage is 100% for unit test. I tried the same configuration and testing in Android generic mobile emulator(Pixel 2 API 29) but in this case both unit and instrumentation test shows 100% code coverage. 

Below are logs for both Android emulator. I have already added READ/WRITE permissions also.

Android Automotive Car Emulator API 29 - Failed

05:47:47 V/InstrumentationResultParser: Error: Failed to generate Emma/JaCoCo coverage.13:32
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser: Time: 2.987
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser: OK (2 tests)
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser: Error: Failed to generate Emma/JaCoCo coverage.
05:47:47 V/InstrumentationResultParser: INSTRUMENTATION_CODE: -1 


Android generic mobile emulator(Pixel 2 API 29) - Success
04:23:59 V/InstrumentationResultParser: Time: 3.089
04:23:59 V/InstrumentationResultParser:
04:23:59 V/InstrumentationResultParser: OK (2 tests)
04:23:59 V/InstrumentationResultParser:
04:23:59 V/InstrumentationResultParser:
04:23:59 V/InstrumentationResultParser: Generated code coverage data to data/data/com.sampleapp.jacocoandroidtest/coverage.ec
04:23:59 V/InstrumentationResultParser: INSTRUMENTATION_CODE: -1 

I wanted to get 100% code coverage in Android Automotive Car Emulator API 29 only.

Thanks for your support.
Keshav

Message has been deleted

Evgeny Mandrikov

unread,
Feb 27, 2021, 6:54:09 AM2/27/21
to JaCoCo and EclEmma Users
On Saturday, February 27, 2021 at 9:50:45 AM UTC+1 Keshav Verma wrote:

Hi 

Objective is to get 100% code coverage for instrumentation test in Android Automotive Car Emulator API 29.

I am trying to run coverage report on android test(instrumentation test) using jacoco version 0.8.0 till 0.8.6 on Android Automotive Car Emulator API 29, test cases are executing successfully but code coverage is 0% for instrumentation test(espresso test). Generated coverage.ec file is empty in the car emulator. 

I also noticed that code coverage is 100% for unit test. I tried the same configuration and testing in Android generic mobile emulator(Pixel 2 API 29) but in this case both unit and instrumentation test shows 100% code coverage. 

Below are logs for both Android emulator. I have already added READ/WRITE permissions also.

Android Automotive Car Emulator API 29 - Failed

05:47:47 V/InstrumentationResultParser: Error: Failed to generate Emma/JaCoCo coverage.13:32
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser: Time: 2.987
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser: OK (2 tests)
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser:
05:47:47 V/InstrumentationResultParser: Error: Failed to generate Emma/JaCoCo coverage.
05:47:47 V/InstrumentationResultParser: INSTRUMENTATION_CODE: -1 


Keshav Verma

unread,
Feb 28, 2021, 11:22:36 PM2/28/21
to JaCoCo and EclEmma Users
Thanks for your reply, but the jacoco lib that I am using, is working fine with Generic Android Mobile emulator, only issue is with the Automotive Car Emulator.
It looks like, lib is not supporting Car emulator variant.

Please suggest or any pointer would be helpful.

Evgeny Mandrikov

unread,
Mar 1, 2021, 4:36:16 PM3/1/21
to JaCoCo and EclEmma Users
As was said before:
Nor Android emulators, nor integration of JaCoCo with Android emulators are not developed by us.
Please consult with developers of Android SDK.

Amit Singh Tomar

unread,
Dec 19, 2023, 3:21:28 AM12/19/23
to JaCoCo and EclEmma Users
Hi Keshav,

Any resolution we found it for Android Car Emulator Code coverage issue? 

Is it resolved now?

Reply all
Reply to author
Forward
0 new messages