Hi folks :slightly_smiling_face: I stumbled upon a...
# kotest
m
Hi folks πŸ™‚ I stumbled upon an issue with the
JUnitXmlReporter
in one of my projects. I set it up according to the documentation, but the final XML files still only contain the leaf name of the tests for nested tests. What I have seen while debugging that the reporter itself is working correctly and directly after doing the file operations in the reporter the XML files are correct. But something happens afterwards overwriting the XML files from the
JUnitXmlReporter
😞 Anyone got an idea or can see the same behaviour? Im using version
4.6.3
of KoTest.
s
You can pass the parameter useTestPathAsName=true to the reporter to get the full test path name
m
Yeah, that is what I did. The reporter does create the file as expected, but something overwrites it afterwards πŸ€” at least it seems like that
s
I wonder if junit platform or gradle overwrites them. Do they generate if you turn off the kotest one
m
How do I turn it off for KoTest? πŸ€”
s
Delete where ever you added the reporter
m
Ok, will check it in a minute.
I have a class extending
AbstractProjectConfig
where I added the reporter to the listeners. When I remove the reporter from the list of listeners, I see the same report getting generated.
But checking if gradle generates the report is a good hint. I will take a look in this direction and see where I end up πŸ™‚
You were right with your guess. It was gradle generating the reports. I had do add:
Copy code
tasks.withType<Test> {
    useJUnitPlatform()
    // this reports block I needed to add
    reports {
        junitXml.required.set(false)
    }
    systemProperty("gradle.build.dir", project.buildDir)
}
To the
build.gradle.kts
and now the report of the
JUnitXmlReporter
does not get overwritten anymore. Thanks for your help!
s
Cool you're welcome
m
Maybe this is worth mentioning in the documentation of the
JUnitXmlReporter
on the page of KoTest? πŸ€”
s
Yes definitely. Wanna PR ?
m
I'm happy to serve a PR, will look at it later in the day πŸ™‚
s
Thanks
πŸ™Œ 1
m
s
thanks merged
m
πŸŽ‰ my first "contribution" to KoTest πŸ˜„
s
first of many πŸ˜‰