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.

Add "generated" annotations for Jacoco

See original GitHub issue

What is your use-case and why do you need this feature? kotlinx.serialization generates methods like patch and getDescriptor, which are then flagged by Jacoco as not having code coverage.

Describe the solution you’d like kotlinx.serialization generates annotations on these methods, which cause Jacoco to filter them: https://groups.google.com/g/jacoco/c/wrXjfq-NmfY/m/WXv4XuXmAAAJ

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:23
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
akuleshov7commented, Oct 12, 2020

Breaks migration from jackson to serialization. Because no one will accept such degradation in code coverage measured by jacoco

5reactions
shanshincommented, Oct 31, 2022

write$self method and $serializer class are marked ACC_SYNTHETIC via f4845b8d. Expected in Kotlin 1.8.20

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated annotation filter detection does not work ... - GitHub
the docs says Generated annotation is detected if it is visible or invisible. That is kind of confusing. I thought SOURCE retention would...
Read more >
Add @Generated annotation to generated code : KT-18714
This would help tooling such as JaCoCo recognize that such code was automatically generated by the compiler, and should be excluded from code...
Read more >
java - How would I add an annotation to exclude a method ...
You can create any annotation with name containing "Generated". I've created the following in my codebase to exclude methods from being included ...
Read more >
Exclusions from Jacoco Report - Baeldung
Basically, this property adds the lombok.@Generated annotation to the relevant methods, classes, and fields of all the classes annotated ...
Read more >
Filter out classes from JaCoCo report using annotaitons
We found out that JaCoCo team in order to support Lombok added a filter which doesn't count coverage of @Generated annotated classes/methods.
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