Kotlin code coverage in CI pipeline
Asked Answered
F

2

6

Interested to find code coverage tools for kotlin that work well in a CI pipeline. use intellij built in code coverage but cant use this in CI. Thanks

Francophile answered 24/11, 2017 at 9:48 Comment(1)
I believe development is happening on various plugins/tools for this. Meanwhile check this: discuss.kotlinlang.org/t/gradle-code-coverage-report/390Tarbes
S
2

The Jacoco plugin works fine for coverage of Kotlin code. Configure Jacoco the same as you would for Java.

https://docs.gradle.org/current/userguide/jacoco_plugin.html

Sloshy answered 25/11, 2017 at 20:58 Comment(1)
JaCoCo incorrectly marks some lines as "partially covered by tests". See #45525779Negligence
J
2

You can use the new kotlinx-kover Gradle plugin compatible with JaCoCo and IntelliJ.

plugins {
     id("org.jetbrains.kotlinx.kover") version "0.5.0"
}

Once applied, the plugin can be used out of the box without additional configuration.

Watch its YouTube announcement video and also track its roadmap from this youtrack issue.

Josselyn answered 6/11, 2021 at 12:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.