Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for Jetpack Compose generated bytecode #1259

Closed
wants to merge 7 commits into from

Conversation

lsuski
Copy link

@lsuski lsuski commented Nov 25, 2021

This PR fixes #1208.
I'm aware that adding such thing to general purpose jvm coverage tool seems strange. Ideally there should be some extension mechanism in JaCoCo which allows adding IFilter in similar way as excludes are added. This could be utilized by android gradle plugin. However as there is no such feature and there is high need from android developers using Jetpack Compose (at least from those who use some coverage quality gates like my company) I decided to submit this PR.

@Godin Godin added this to Awaiting triage in Filtering via automation Nov 25, 2021
@Avenire
Copy link

Avenire commented Mar 31, 2022

@lsuski Tried your fork in my Compose project and it works great with instrumentation tests.
Unfortunately Roboelectric unit tests report now 0% coverage, where with 0.8.7 Jacoco, they at least report somewhat correct instruction coverage. Would it be possible to support both?

Pushed an example project showing the problem in case you weren't aware of the issue:
https://github.com/Avenire/jacoco-compose-test

@lsuski
Copy link
Author

lsuski commented Apr 1, 2022

I'll check, in my projects I have some roboletric tests and coverage is quite fine (there are some uncovered lines even though they should be but the coberage is about 70%)

@sarn0ld
Copy link

sarn0ld commented Mar 14, 2023

Hey @lsuski ! Awesome work!
What's the easiest way to use your fork in our projects?

@lsuski
Copy link
Author

lsuski commented Mar 14, 2023

@sarn0ld you have to build my fork on your own. I didn't publish it publicly. I use my company internal maven repo

@G00fY2
Copy link

G00fY2 commented May 17, 2023

Any chance this will get merged soon? For me it is not clear whats blocking this PR?

@lsuski
Copy link
Author

lsuski commented May 17, 2023

I think that the main problem is that JaCoCo is meant to be Jvm general coverage tool and should not have any specific frameworks filters and JetPack Compose is a niche from JaCoCo perspective. IMHO JaCoCo should have some extension mechanism which will allow registering such filters on demand and then there will be no need to add Compose filter here, it will be added by Android Gradle Plugin or any other third party Plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Filtering
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

Jacoco reports low coverage with Compose tests
5 participants