-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Code coverage incorrect for Kotlin data classes with kotlinx.serialization in JaCoCo 0.8.13 #1855
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
Comments
I tried to narrow down what changed from version 0.8.12 and why these generated methods are not ignored but without much success
|
@Dukoff92 first of all thank you for testing snapshot version and for the report ❤ This seems to be consequence of #1700 unfortunately unforeseen and overlooked. Unfortunately we had no time to look into this regression and there were pressure to release 0.8.13 for Java 24. Thank you for your understanding. |
Any recommendation on a workaround? I can't downgrade to 0.8.12, but I also don't want to manually implement code to cover for all this. Is there a way to add these generated methods to exclusions without actually ignoring the entire classes? |
Hey, @vdurante! Unfortunately, I tried multiple things, but could not find a way to bypass the generated methods only. I am waiting for it to be fixed (there is a task in the To-do section) and then I will be using version 0.8.14-SNAPSHOT until the official version gets released. |
Uh oh!
There was an error while loading. Please reload this page.
I am experiencing incorrect code coverage when using JaCoCo version 0.8.13 with Kotlin data classes that utilize kotlinx.serialization. It appears that generated parameters and functions are not properly excluded from coverage, which leads to incorrect results.
This issue did not occur in version 0.8.12, where the coverage was reported correctly.
Steps to Reproduce:
gradle version: 8.12.1
kotlin version: 2.1.10
Use Kotlin data classes with kotlinx.serialization
Run JaCoCo with version 0.8.13
Example data class:
Expected behavior:
Generated serialization-related code should be excluded from the coverage report, as it was in version 0.8.12
Actual Behavior:
The report includes functions and constructors that should be excluded or covered
Coverage for these generated elements is reported as 0%
Version 0.8.13

Version 0.8.12

The text was updated successfully, but these errors were encountered: