interz12 wrote
I have my unit/integration tests accessing my database with data in it. The "test" datasource is in "update" mode. After running test-app, my data is gone even though my integration tests for the domain classes do nothing. I have to restore from a database backup after running "test-app"
Hi Interz,
Pretty sure this behavior is intended operation though, like a lot of Grails, it isn't actually documented. The framework deletes the data for all the referenced domains for each test so that it is in a known state and tests can be written independently.
While the datasource mode can have a similiar effect in other contexts (if you use create-drop) I think the 'update' mode is more about the schema than the data contained (e.g. should a new column be added to a table.)
I could be completely wrong about all of this but it seems consistent with my own experience. I'm going to edit the wiki to at least mention the delete-after-test-method behavior since I was confused about that as well.
::mark