-
Notifications
You must be signed in to change notification settings - Fork 53
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
Question/feature request: possibility to exclude functions annotated with given annotation (e.g. Composables) from coverage calculation #121
Comments
Related feature idea - provide an annotation like @KoverExclude that can be manually added to classes and functions to exclude from coverage. This would be preferable in my view to long lists of exclusions in gradle files which lack the context of what those classes are. |
I second the idea -- it would be nice to both have |
@stantronic suggestion is great. As one use case, it would make possible remove Compose @Preview(s) from code coverage. |
I tried using
Since jacoco/jacoco#1208 was closed as won't fix, I would gladly switch to the IntelliJ agent if it provided better support for Compose. |
Huge |
Implemented in |
One of the biggest struggles with code coverage in my Android project is that we have a very little code coverage reported by the JaCoCo due to the fact that the project uses Jetpack Compose. We calculate unit tests coverage, however, Composables should be tested using UI tests (https://developer.android.com/jetpack/compose/testing). We'd like to exclude
@Composable
-annotated Kotlin functions from unit tests coverage calculation, however, there's no way to do this with JaCoCo (jacoco/jacoco#1208, jacoco/jacoco#1259). If kover would support to exclude such code, that would be a game changer for us and definitely we would switch from JaCoCo to kover, once it's stable.The text was updated successfully, but these errors were encountered: