Is it possible to have the scalatest runner in sbt also run junit tests?
The section in the scalatest docs about junit:
http://www.scalatest.org/getting_started_with_junit_4_in_scalais about doing the opposite: writing your tests in scala w/ scalatest, but running with junit. I have the opposite problem: I have a codebase which has some tests written in Java using junit, and I'd like to have sbt run those junit tests via the scalatest runner.
The reason I want this is from my attempt to exclude IntegrationTests with a test tag. It means that I run my tests with something like:
test-quick * -- -l testTag
We've been running those tests using the junit-interface plugin for sbt:
https://github.com/sbt/junit-interfaceIt seems like all those args after "--" are passed to both test runners. From the junit-interface docs: "Any parameter not starting with - or + is treated as a glob pattern for matching tests." Which means that the testTag for scalaTest ends up becoming a glob pattern for the junit interface, and so all junit tests are skipped.
Fundamentally the difference in the way the args work between the junit-interface and the scalatest runner seem like it is going to create big problems with a project that uses tests written with both junit & scalatest.
There is another question of how to do the equivalent of test tags in our junit tests, but it seems like we can probably do the same thing with junit categories or something.
(If you are really curious, I'm messing with this for Apache Spark, you can track the issue here:
)
thanks
Imran