Configuring junitxml output for specs2 tests in sbt 0.10

How to configure sbt 0.10 to use junitxml option with specs2?

The specs2 documentation says that this is the way to do this using sbt 0.7.x:

override def testOptions = super.testOptions ++ Seq(TestArgument("junitxml"))

How can I say the same in sbt 0.10?

+7
source share
2 answers

This is described here in the SBT documentation:

 testOptions in Test += Tests.Argument("junitxml") 

And if you want to specify this parameter specifically for specs2:

 testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "junitxml") 
+7
source

FYI, I found that when running Specs2 tests with juntxml SBT, the failure to complete tests failed. Adding a “console” as another argument causes the assembly to fail, as you would expect. I suspect this is some interaction between the console reporter and the sbt test driver.

testOptions in Test + = Tests.Argument (TestFrameworks.Specs2, "junitxml", "console")

+11
source

All Articles