how do I make play framework (2.1) export test results in xunit format

jenkins, playframework, playframework-2.1, sbt, xunit

Solution

Play 2.1.1 writes the test reports to target/test-reports.

For Java no further configuration is necessary, but for Scala adjust your project/Build.scala:

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "so-scala"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm
  )


  val main = play.Project(appName, appVersion, appDependencies).settings(
    //write test reports and to console
    testOptions in Test += Tests.Argument("junitxml", "console")
  )

}

Problem

Using the play! framework (play2) - I am running tests via "play test". This pretty prints the results - but I would also like the results to be put in the xunit "XML" format that all CI servers understand how to graphically report on.

Original source