I'm trying to get a hierarchical test report from Kotlintest using Gradle. I've seen some screenshots allowing it, however, I have no luck. For any type of tests (FunSpec, WordSpec, BehaviorSpec etc) I always see only the class name and then the "leaf" tests.
- Gradle 5.6.2
- Kotlintest 3.4.2
- JUnit Platform 1.5.2
Sample test class
import io.kotlintest.matchers.string.shouldStartWith
import io.kotlintest.specs.FunSpec
class HierarchicalTest : FunSpec({
context("Here is a context 1") {
test("Test 1") {
"abc".shouldStartWith("a")
}
}
context("Here is a context 2") {
test("Test 2") {
"abc".shouldStartWith("b")
}
}
})
build.gradle
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.41'
}
sourceCompatibility = 1.8
repositories {
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testImplementation 'ch.qos.logback:logback-classic:1.2.3'
testImplementation 'io.kotlintest:kotlintest-runner-junit5:3.4.2'
testImplementation 'org.junit.platform:junit-platform-engine:1.5.2'
}
test {
useJUnitPlatform()
}
IntelliJ result
Gradle report
What do I need to do to have the context
level visible in the report?