Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 612
Michael Neale Avatar asked Apr 04 '13 07:04

Michael Neale


1 Answers

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")
  )

}
like image 91
Schleichardt Avatar answered Oct 13 '22 09:10

Schleichardt