Skip to content

Wrong code coverage percentage when we have Preview function in our class #736

@ItSNeverLate

Description

@ItSNeverLate

Describe the bug
I can not exclue my functions which were annotated by @Preview (androidx.compose.desktop.ui.tooling.preview.Preview) in my KMP project.

@Preview
@composable
@KoverIgnore
private fun Preview() {
AppTheme {

.........

kover {
reports {
verify {
rule {
minBound(80) //80% minimum coverage
}
}
filters {
excludes {
// Entire Points
classes("MainKt") // Desktop
classes("*.MainActivity") // Android

            // Generated Classes and Resources
            classes("*.generated.*")

            // Dependency Injection
            classes("*.di.*")

            // Compose Related (UI)
             classes("*ComposableSingletons*")
            annotatedBy(
                "androidx.compose.desktop.ui.tooling.preview.Preview",
                "KoverIgnore"
            )
        }
    }
}

}

Image

Environment

  • Kover Gradle Plugin version: 0.9.1
  • Gradle version: 8.10.2
  • Kotlin project type: Multiplatform
  • Coverage Toolset: Kover

Metadata

Metadata

Assignees

Labels

BugBug issue typeS: untriagedStatus: issue reported but unprocessed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions