1

I'm testing my app in the interactive console, which I access by 'grails-debug test'.

Then I run my integration tests 'test-app integration:' which goes fine.

But when I change any of my controllers that are being tested, the change does not take effect in my tests results, and I have to quit interactive mode and access it again.

How can I make my tests reload my controllers?

P.D.: My question is much motivated by Grails Guard plugin, which indicates in its usage seccion:

'Ensure that the spring reloading agent is active for test-app (it is NOT by default for test-app, only run-app).'

Tomas Romero
  • 8,418
  • 11
  • 50
  • 72

2 Answers2

5

Add -reloading to your grails call as the first parameter.

Jeff Beck
  • 3,944
  • 3
  • 28
  • 45
2

After trying the solution proposed by Jeff Beck, I would like to share some examples to clarify:

grails -reloading -> reload
grails -> reload
grails-debug -reloading -> reload
grails-debug -reloading test -> reload
grails-debug test -> no reload
grails-debug test -reloading -> no reload

I tested this by adding and commenting an exception first in 1 of my controllers and then in 1 of my domain classes, and the reload worked on both.

Tomas Romero
  • 8,418
  • 11
  • 50
  • 72