Nested Test Names broken in in Kotest 5 (worked in Kotest 4)
See original GitHub issueWhich version of Kotest are you using 5.3.1
Nested test names are broken in Kotest 5+:
class `Level 0` : FreeSpec({
"Level 1" - {
"Level 2" - {
"Level 3.1" {
}
"Level 3.2" {
fail("")
}
}
}
})
In Gradle it looks like this:
> Task :tests:test
Level 0 > Level 0 > Level 0 > Level 3.2 FAILED
java.lang.AssertionError at KotestBroken.kt:10
Caused by: java.lang.AssertionError at KotestBroken.kt:10
It does not matter which Testing Style (that supports nesting) I use. I would expect the test report to reflect the hierarchy, as it did in Kotest 4.6.3 (only “failed” (yellow) vs “error” (red) could have been more consistent):
Issue Analytics
- State:
- Created a year ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
For nested tests, the report uses an incomplete test name
I can confirm from #3068 that it's broken in Gradle 6 but works in Gradle 7 with otherwise similar dependencies (io.kotest:kotest-runner-junit5: ...
Read more >Changelog
Duplicated test names no longer throw an automatic error, but now mangle the name. So two tests of name 'foo' will appear as...
Read more >Nested Data Tests
Kotest's data testing is extremely flexible and allows to unlimited nesting of data test constructs.
Read more >Testing Styles
Kotest offers 10 different styles of test layout. Some are inspired from other popular test frameworks to make you feel right at home....
Read more >Data Test Names
Data Test Names. By default, the name of each test is simply the toString() on the input row. This typically works well for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’re unlikely to add a workaround for a bug in gradle 6.x due to the age of that release and the number of junit bugs it contains.
@stengvac please test with latest version of kotest and raise a new issue if the problem persists, since this turned out to relate to a gradle 6.x bug. Preferably along with a screenshot showing the problem.