question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The code coverage from RobolectricTestRunner unit test code is not honored.

See original GitHub issue

First of all, thank you for making the effort writing this gradle library to generate the code coverage. After exploring an ocean of blogs, github sample, code snippet, etc for the past three days, I finally come across this repository, the best one and the most potential one that is to rule the world of unified code coverage report. All of other repositories carry all kind of issues, such as out-of-date gradle config, verbose configuration for every module, etc. Only this one gets things done at the most sensible way. So thank you, again. I would never imagine that it has been so challenging to get multiple code coverage report generated.

I have been conducting test with this library. Other than the known issues that you mentioned in the README, I am reporting a new issue. It seems that the code coverage from RobolectricTestRunner unit test code is not honored. You could reproduce this issue from this code sample project. Basically, I just copied the code from your multi-module and added an unit test run by RobolectricTestRunner. From the Android Studio Code Coverage report, it says the code is unit test coveraged. But the generated one from rootCodeCoverageReport says the otherwise.

Would you please confirm this issue ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TonyTangAndroidcommented, Mar 18, 2021

For the actual details, please refer to this pull request https://github.com/TonyTangAndroid/NeoTechCodeCoverageSample/pull/3

0reactions
TonyTangAndroidcommented, Mar 19, 2021

Awesome. Thank you for the clarification. This is by far the best coverage tools that I have ever come across the whole Internet. Combining the codecov support, it is unbelievable easy to get it set-up, which used to be unbelievably challenging to set it up properly prior this repo. Appreciate for this excellent work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coverage fails with Robolectric tests in AndroidStudio #3023
We have upgraded to robolectric 3.4.2 and running the unit tests is creating an empty (zero bytes) jacoco code coverage .exec file now....
Read more >
JaCoCo doesn't work with Robolectric tests - Stack Overflow
I managed to get code coverage working for Robolectric at an old job, but that was a year ago and I no longer...
Read more >
Unit Testing with Robolectric | CodePath Android Cliffnotes
The code below shows a basic Robolectric test that verifies the text inside of a TextView. It's based off the standard new project...
Read more >
Unified Code Coverage for Android: Revisited - ProAndroidDev
My post Setting up a unified coverage report in Android with Jacoco, Robolectric, ... for the unit tests — otherwise, the Robolectric tests...
Read more >
Setting up an unified coverage report in Android with Jacoco ...
Test coverage reports are an important tool to measure how much our tests actually exercise our code. Although not guaranteed a bug-free ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found