IntelliJ does a nice job with @Serializable when g...
# serialization
p
IntelliJ does a nice job with @Serializable when generating code coverage info but Jacoco still has problems (I’m guessing with annotations that Kotlin needs to fix). In any case, is anyone aware of workarounds or solutions that get Jacoco to 100% on @Serializable code?
g
Maybe just add some filter for classes with @Serializable annotation? Jacoco already have some support of Kotlin generated code, I would report it to kotlinx.serialization or jacoco to support coverage
s
How does Jacoco deal with other generated code? (copy method of data classes, etc)
Serialization methods don't have line numbers, so they should not be visible to Jacoco anyway...
p
Fwiw, this screenshot shows in red items that IntelliJ does not complain about. All are related to @Serializable.
@sandwwraith can you offer a little guidance on how to construct a filter for one or more of these items?
I’m assuming we are talking about adding elements via the “excludes = […]” parameter to the
jacoco
closure.
s
I'm not very familiar with filters, but probably you can exclude every
write$Self
function and constructors which contain
SerializationConstructorMarker
as the last argument