Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a single test in scalatest from maven

Tags:

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 
like image 938
WestCoastProjects Avatar asked Jul 20 '14 16:07

WestCoastProjects


1 Answers

tl;dr mvn test -Dsuites="some.package.SpecsClass"


I found an answer from here and it works:(https://groups.google.com/forum/#!topic/scalatest-users/Rr0gy61dg-0)

run test 'a pending test' in HelloSuite, and all tests in HelloWordSpec:

 mvn test -Dsuites='org.example. HelloSuite @a pending test, org.example.HelloWordSpec'  
  • run all tests in HelloSuite containing 'hello':

    mvn test -Dsuites='org.example.HelloSuite hello'

for more details: http://scalatest.org/user_guide/using_the_scalatest_maven_plugin

like image 97
user1132007 Avatar answered Oct 20 '22 04:10

user1132007