7mind / izumi

Productivity-oriented collection of lightweight fancy stuff for Scala toolchain
https://izumi.7mind.io
BSD 2-Clause "Simplified" License
613 stars 66 forks source link

Fix testkit on sbt launching tests defined in other test modules when depending on another test artifact #2052

Closed neko-kai closed 8 months ago

neko-kai commented 8 months ago

This workaround alters the classpath scanning logic to only consider classes defined in the first test-classes directory encountered on the classpath to be those defined in 'current module'. It seems that for SBT the heuristic that the current test module classes will be placed in the first test-classes dir on the classpath generally holds. However, if it fails, you may be able to fix test running by overriding _sbtIsClassDefinedInCurrentTestModule or _sbtFindCurrentTestModuleClasspathElement in your tests to suit your needs.

Also fix DistageScalatestTestSuiteRunner#modifyClasspathScan modifier not being applied (it was never applied, ugh...)