How to generate a single report file for a multi m...
# kotest
s
How to generate a single report file for a multi module gradle project?
s
Reports are generated via the standard gradle/junit mechanisms, so whatever works for that, will work for kotest
e
I remember that was quite hard to find an answer to when searching, and examples from official gradle docs weren't working.. This is how I ended up doing, perhaps it can be improved, let me know..
Copy code
val testReport = tasks.register<TestReport>("testReport") {
    destinationDir = file("$buildDir/reports/tests/test")
    reportOn(subprojects.flatMap { it.tasks.withType<Test>().map { it.binaryResultsDirectory.get() } })
}

subprojects {
    tasks.withType<Test> {
        finalizedBy(testReport)
        useJUnitPlatform()
        reports.junitXml.isEnabled = false
        reports.html.isEnabled = false
    }
}
(above goes in root
build.gradle.kts
)
s
I tried above approach, but when I was running tests for moduleA only, it was trying to run tests for moduleB also (moduleA depends on moduleB) I dont think I did any config wrong, but ill recheck it again when I get time