Domanda

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.

È stato utile?

Soluzione

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

}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top