Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Code coverage incorrect for Kotlin data classes with kotlinx.serialization in JaCoCo 0.8.13 #1855

Copy link
Copy link
Open
@Dukoff92

Description

@Dukoff92
Issue body actions

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:

@Serializable
data class User(
    @SerialName("name")
    val name: String? = null,

    @SerialName("age")
    val age: Int? = null
)

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
Image

Version 0.8.12
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Progress
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.