Running mixed java/scala testing using scalatest

96 views
Skip to first unread message

Assaf Mendelson

unread,
Apr 19, 2017, 11:31:31 AM4/19/17
to scalatest-users

I have a project which uses both scala and java in the same project (and same module).


The project uses maven with the surefire plugin to run junit java tests.


I have created tests for the scala portion using scalatest. If I add the @RunWith(classOf[JUnitRunner]) to the scala tests then surefire runs them fine.


The problem is that I can't figure out how to configure scalatest in this case (e.g. there is no reporter so nothing is printed out unless there is an error and info, given etc. are never printed. There is no support for tagging definition etc.).


I tried using the scalatest maven plugin, however this turns surefire off and therefore my java tests are not run.


Since I also use @ClassRule and use failsafe for integration test, I would prefer a way to configure surefire to pass on the relevant configuration.


Does anyone know how to add configuration in this case for reporter, tags etc.? If that is not possible, is there a way to run scalatest maven plugin in parallel with surefire so that the tests would not occur twice and I would be able to still use junit annotations such as @ClassRule?


BTW the same issue occurs in intellij, if I use the @RunWith annotation, no reporting is done.

Reply all
Reply to author
Forward
0 new messages