views:

314

answers:

1

I'm working on a project using Scala running Selenium tests as part of a continuous integration process. Hudson displays very helpful information based on the results in the surefire reports but I would much prefer using sbt to Maven. Is there an existing way to get sbt to generate surefire reports from sbt tests?

+1  A: 

There are three approaches to achieve this. I think the first would be a great contribution to make to SBT!

Write a TestsListener for SBT to generate Surefire XML reports

There is currently no unified reporting, as per the Maven surefire plugin. It would be possible to add this to SBT with a custom TestsListener.

Pass arguments to the test framework to trigger XML generation

I don't think Specs or ScalaTest support the Surefire XML format directly. It was recently requested for ScalaTest.

Use a JUnit adapter for your tests, and use the JUnitRunner

ScalaTest and Specs provide traits you can mix in to your tests so they are compatible with JUnit. JUnit support in SBT is being re-integrated right now, but I don't know if it will support this.

Specs itself uses the Maven + Surefire for it's Hudson build.

retronym