Search code examples
unit-testingplayframeworkplayframework-2.2specs2

'play test' always returns success


I have a Play 2.2 Scala project, with my unit tests in the test directory. This is a brand new Play app - all I've done is run play new testapp and then update the assert in the given ApplicationSpec.scala to fail.

When I run play test the tests run, and the errors are correctly printing to the console. However, the process still returns 'success.' Is there any way to get test to return an error?

My build.sbt is here (unchanged) :

name := "testapp"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache
)

play.Project.playScalaSettings

play test prints the following:

//console output

[info] Total for specification ApplicationSpec

[info] Finished in 105 ms

[info] 2 examples, 1 failure, 0 error

[info] Passed: Total 0, Failed 0, Errors 0, Passed 0

[success] Total time: 5 s, completed Oct 21, 2014 2:36:35 PM

Is there any way to have that last line print [error] with some information about which tests failed?


Solution

  • Fixed by upgrading from Play 2.2.0 to Play 2.2.5.