2

There have been several questions about this on SO already, but none of the answers was satisfactory. I am doing test-driven grails development. However, because STS keeps crashing, I can't use it to run the unit tests and run them using "grails test-app" on the command line instead. This is fine, but when a test fails, it just won't print the REASON for the failure to the console. Using -echoOut and -echoErr as suggested in other threads does not help, this will only print stuff that was logged or printed during the test, but not the JUnit or Spock reason of failure. So currently, I always have to wait for the HTML to be generated and then find the failure in my browser and this reallly slows me down. I will accept any solution, no matter how hacky (i.e. hacking it into the grails source and recompiling it would be fine with me!).

1 Answer 1

1

You can do something like this...

grails test-app -echoOut -echoErr Something.testMain ; cat ./target/test-reports/plain/TEST-integration-integration-SomethingTests.txt
3
  • Oh yeah, forgot I had been toying around with the plain text files already :( That's only a little bit better because I still have to wait for grails to shut down completely which is a couple of seconds after the actual failure.
    – c089
    May 2, 2011 at 14:41
  • 1
    In Unix, tail -f ./target/test-reports/plain/TEST-integration-integration-SomethingTests.txt & && grails test-app -echoOut -echoErr Something.testMain should work. May 2, 2011 at 21:31
  • That's not a bad idea, although still cumbersome. This might be solved in 2.0: "* Unit test scaffolding and enhanced unit test output in the console " grails.1312388.n4.nabble.com/…
    – c089
    Jul 19, 2011 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.