I am using Spek to test my Kotlin app. I would like to publish my tests report after Jenkins build. JUnit or TestNG would generate XML report which Jenkins can use to generate tests stats.
Does Spek generate such report? If so, how to configure my Gradle project to get it? If not, what are the other reporting options available?
I haven't checked thoroughly my build
directory. Since Spek is using JUnit 5 Platform Engine it will produce reports the same way as JUnit 5 would have done.
Indeed, after running ./gradlew clean build
you can see the file here: ./build/reports/junit/TEST-spek.xml
. I used Jenkins to publish JUnit XML report after build and it works fine.
If you'd like to change reports directory, you should configure it in Gradle build script as follows.
junitPlatform {
reportsDir file("$buildDir/your/path")
filters {
engines {
include 'spek'
}
}
}
Source, JUnit 5 User guide: http://junit.org/junit5/docs/current/user-guide/#running-tests-build