javadba javadba - 6 months ago 64
Scala Question

How to run a single test in scalatest from maven

I have not found any documentation on how to do this. For JUnit the equivalent would be:

mvn -Dtest=org.apache.spark.streaming.InputStreamSuite test


Note that if you have some Java tests in the same module, as much of spark does, you need to turn them off -which you can do by telling surefire to run a test that isn't there

Here is the test that I've just been running

mvn test -Dtest=moo -DwildcardSuites=org.apache.spark.deploy.yarn.ClientSuite

That skips the java test and only runs the scala one.

One thing which scalatest doesn't seem to do is let you run a single test within a suite, the way maven surefire does. That's not ideal if you have one failing test in a big suite.