[#37] Configure coverage with Kover

This commit is contained in:
Carter Jernigan 2022-06-03 09:41:35 -04:00 committed by Carter Jernigan
parent e5744c934f
commit fb955158f3
6 changed files with 29 additions and 2 deletions

View File

@ -4,6 +4,7 @@ This code review checklist is intended to serve as a starting point for the auth
<!-- NOTE: Do not modify these when initially opening the pull request. This is a checklist template that you tick off AFTER the pull request is created. -->
- [ ] Self-review: Did you review your own code in GitHub's web interface? _Code often looks different when reviewing the diff in a browser, making it easier to spot potential bugs._
- [ ] Automated tests: Did you add appropriate automated tests for any code changes?
- [ ] Code coverage: Did you check the code coverage report for the automated tests? _While we are not looking for perfect coverage, the tool can point out potential cases that have been missed. Run `./gradlew check` then coverage reports are generated under `build/reports/kover`.
- [ ] Documentation: Did you update documentation as appropriate? (e.g [README.md](../blob/master/README.md), etc.)
- [ ] Rebase and squash: Did you pull in the latest changes from the main branch and squash your commits before assigning a reviewer? _Having your code up to date and squashed will make it easier for others to review. Use best judgement when squashing commits, as some changes (such as refactoring) might be easier to review as a separate commit._
@ -14,5 +15,5 @@ This code review checklist is intended to serve as a starting point for the auth
- [ ] Ad hoc review: Did you perform an ad hoc review? _In addition to a first pass using the code review guidelines, do a second pass using your best judgement and experience which may identify additional questions or comments. Research shows that code review is most effective when done in multiple passes, where reviewers look for different things through each pass._
- [ ] Automated tests: Did you review the automated tests?
- [ ] Manual tests: Did you review the manual tests?
- [ ] How is Code Coverage affected by this PR? _We encourage you to compare coverage before and after changes and when possible, leave it in a better place._
- [ ] How is code coverage affected by this PR? _We encourage you to compare coverage before and after changes and when possible, leaving it in a better place._
- [ ] Documentation: Did you review Docs and [README.md](../blob/master/README.md) as appropriate?

View File

@ -11,6 +11,7 @@ dependencyLocking {
plugins {
id("bip39.ktlint-conventions")
alias(libs.plugins.detekt)
alias(libs.plugins.kover)
alias(libs.plugins.versions)
}
@ -45,8 +46,12 @@ tasks {
}
}
val unstableKeywords = listOf("alpha", "beta", "rc", "m", "ea", "build")
kover {
isDisabled = !project.property("BIP39_IS_COVERAGE_ENABLED").toString().toBoolean()
jacocoEngineVersion.set(libs.versions.jacoco.get())
}
val unstableKeywords = listOf("alpha", "beta", "rc", "m", "ea", "build")
fun isNonStable(version: String): Boolean {
val versionLowerCase = version.toLowerCase()

View File

@ -39,15 +39,19 @@ org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.6.21=classpath
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.6.21=classpath
org.jetbrains.kotlin:kotlin-scripting-jvm:1.6.21=classpath
org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib:1.5.31=classpath
org.jetbrains.kotlin:kotlin-tooling-metadata:1.6.21=classpath
org.jetbrains.kotlin:kotlin-util-io:1.6.21=classpath
org.jetbrains.kotlin:kotlin-util-klib:1.6.21=classpath
org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin:0.5.0=classpath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.1.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-core:1.1.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.1.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0=classpath
org.jetbrains.kotlinx:kover:0.5.0=classpath
org.jetbrains:annotations:13.0=classpath
xmlpull:xmlpull:1.1.3.1=classpath
empty=

View File

@ -43,6 +43,14 @@ io.gitlab.arturbosch.detekt:detekt-tooling:1.20.0=detekt
io.gitlab.arturbosch.detekt:detekt-utils:1.20.0=detekt
net.java.dev.jna:jna:5.6.0=detekt,ktlint
org.ec4j.core:ec4j-core:0.3.0=ktlint
org.freemarker:freemarker:2.3.30=IntellijKoverConfig
org.jacoco:org.jacoco.agent:0.8.8=JacocoKoverConfig
org.jacoco:org.jacoco.ant:0.8.8=JacocoKoverConfig
org.jacoco:org.jacoco.core:0.8.8=JacocoKoverConfig
org.jacoco:org.jacoco.report:0.8.8=JacocoKoverConfig
org.jetbrains.intellij.deps:coverage-report:1.0.15=IntellijKoverConfig
org.jetbrains.intellij.deps:intellij-coverage-agent:1.0.656=IntellijKoverConfig
org.jetbrains.intellij.deps:intellij-coverage-reporter:1.0.656=IntellijKoverConfig
org.jetbrains.intellij.deps:trove4j:1.0.20200330=detekt,ktlint
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.20=detekt,ktlint
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.20=detekt,ktlint
@ -58,6 +66,12 @@ org.jetbrains.kotlinx:kotlinx-serialization-core:1.1.0=detekt,ktlint
org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.1.0=detekt,ktlint
org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0=detekt,ktlint
org.jetbrains:annotations:13.0=detekt,ktlint
org.jetbrains:annotations:16.0.2=IntellijKoverConfig
org.json:json:20210307=IntellijKoverConfig
org.ow2.asm:asm-analysis:9.1=JacocoKoverConfig
org.ow2.asm:asm-commons:9.1=JacocoKoverConfig
org.ow2.asm:asm-tree:9.1=JacocoKoverConfig
org.ow2.asm:asm:9.1=JacocoKoverConfig
org.slf4j:slf4j-api:1.7.32=ktlint
org.yaml:snakeyaml:1.30=detekt
empty=annotationProcessor,compileClasspath,detektPlugins,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath

View File

@ -9,6 +9,7 @@ org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m
kotlin.mpp.stability.nowarn=true
BIP39_IS_TREAT_WARNINGS_AS_ERRORS=true
BIP39_IS_COVERAGE_ENABLED=true
JVM_TOOLCHAIN=17
JVM_TARGET=1.8

View File

@ -1,5 +1,6 @@
[versions]
# Kotlin version is defined in gradle.properties
jacoco = "0.8.8"
kotest = "4.6.1"
ktlint = "0.45.2"
moshi = "1.9.2"
@ -14,5 +15,6 @@ moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "mosh
[plugins]
detekt = "io.gitlab.arturbosch.detekt:1.20.0"
dokka = "org.jetbrains.dokka:1.6.21"
kover = "org.jetbrains.kotlinx.kover:0.5.0"
publish = "com.vanniktech.maven.publish:0.18.0"
versions = "com.github.ben-manes.versions:0.42.0"