You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm kind of understanding the pattern here ... the following code will behave properly, but it is nevertheless different from native scalatest runner:
package com.tribbloids.spookystuff.spike
import org.scalatest.Suite
import org.scalatest.funspec.AnyFunSpec
class NestedTestsSpike extends AnyFunSpec {
it("c") {}
}
object NestedTestsSpike {
class Nested extends AnyFunSpec {
it("a") {}
it("b") {}
}
class N1 extends Nested
class N2 extends Nested
}
it appears that the JUnit 5 runner will treat every object as a package and try to discover all the test suite within (both classes & objects), but the nestedSuites cases will be inserted into the enclosing suite without adding any qualifier, causing multiple nested suites to have conflicting names
I'll see if it can be traced in debugging the plugin, maybe it's an easy fix
tribbloid
added a commit
to tribbloid/scalatestplus-junit5
that referenced
this issue
May 7, 2025
Here is a short example when being used with Gradle (latest version):
upon test execution:
Task :module:sanity:test
com.tribbloids.spookystuff.spike.NestedTestsSpike$N1$ > a PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike$N1$ > b PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike$N2$ > a PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike$N2$ > b PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike$Nested > a PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike$Nested > b PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike > a PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike > b PASSED
com.tribbloids.spookystuff.spike.NestedTestsSpike > c PASSED
BUILD SUCCESSFUL in 2s
15 actionable tasks: 1 executed, 14 up-to-date
there are plenty of test cases with unknown origin (highlight in bold text)
where did they come from?
The text was updated successfully, but these errors were encountered: