Skip to content
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

Kotlinx Serialization annotation line included in the coverage report #686

Open
saurabh-somani-philips opened this issue Sep 13, 2024 · 4 comments
Assignees
Labels
Bug Bug issue type S: confirmed Status: bug is reproduced or present

Comments

@saurabh-somani-philips
Copy link

Describe the bug
Recently, I updated the Kover version in my KMM project from 0.8.1 to 0.8.3, and I noticed my data classes annotated with @Serializable were not fully covered. The annotation line looks yellow in the HTML report, stating it is partially covered.

I've tried excluding "*.*serializer*" from coverage report (as mentioned in some previous issue reported 1 or 2 years ago), but it didn't help.

Errors
N/A

Expected behavior
Data class should be fully covered, ignoring the @Serializable annotation line. I don't want to exclude the whole data class to solve this issue, just the annotation part. Am I doing something wrong or Kover needs to consider updating itself after Kotlin 2.0 update (I'm using v2.0.20)?

Reproducer
N/A

Reports
This is my data class in the Kover report:
image

This is the coverage summary:
image

Environment

  • Kover Gradle Plugin version: 0.8.3
  • Gradle version: 8.7
  • Kotlin project type: Kotlin/Multiplatform
  • Coverage Toolset (if customized in build script): Kover
  • Other context important for this bug: Kotlin version - 2.0.20
@saurabh-somani-philips saurabh-somani-philips added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Sep 13, 2024
@saurabh-somani-philips saurabh-somani-philips changed the title Kotlinx Serialization annotation line considered in the coverage report Kotlinx Serialization annotation line included in the coverage report Sep 13, 2024
@shanshin
Copy link
Collaborator

Hi,
do you have the option to exclude companions ("*\$Companion") for serializable classes from the report?
If so, does it fix your issue?

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Sep 17, 2024
@saurabh-somani-philips
Copy link
Author

saurabh-somani-philips commented Sep 18, 2024

@shanshin
I tried excluding it from the coverage report. The Companion object's coverage disappears, but main data class's 'Branch' and 'Instruction' coverage still has some coverage left. The same is reflected in our SonarQube report, so the ultimate aim is to fix the Sonar report coverage.

image image

@shanshin shanshin added S: confirmed Status: bug is reproduced or present and removed S: waiting for clarification Status: additional information required to proceed labels Sep 22, 2024
@johngray1965
Copy link

Similiar issue with android's @parcelize
image

@mgroth0
Copy link

mgroth0 commented Oct 24, 2024

Confirming I have this issue too with @Serializable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: confirmed Status: bug is reproduced or present
Projects
None yet
Development

No branches or pull requests

4 participants