Open charpov opened 2 years ago
If you want gradle test filtering to work naturally then you probably need to migrate to https://github.com/helmethair-co/scalatest-junit-runner.
This plugin attempts to shim between gradle and the scalatest runner, which have different approaches to filtering.
I had a look at the plugin you mentioned, but it doesn't seem to support Scala 3, and I didn't want it to bring a whole new host of problems. I can run tests in individual packages using IntelliJ, so I can probably figure out a way to run Scalatest directly without going through Gradle.
In my experience nothing works perfectly - I tend to use IntelliJ's native build and test, but this too fails to run certain types when individual tests are selected.
On Scala 3 support via the scalatest-junit-runner, it seems to work out of the box on a simple test project.
I'm struggling a bit with test filtering, not sure of what should and shouldn't work.
runs all my tests, as expected.
only runs the specified class.
also runs the specified class, but runs it twice.
runs nothing.
crashes with an exception:
The exception seems to suggest that
*
is used as regex syntax, not wildcard. Indeed:runs the class (twice). On the other hand,
run nothing.
This is all a bit puzzling. Ultimately, my goal is to run all the test classes in a specific package, like
chap01
.My setup is a little complicated, but I'm using Gradle 7.5, Scala 3.1.3, and ScalaTest 3.2.12.