grails integration test case preserve data for investigation

We were used to running our grails integration test against in memory HSQLDB database, but at the failure point it was difficult to investigate as the data was lost. We migrated to running the test against the physical database(postgres) and all is well when the tests passes. At any point if the tests fail we want the data to be committed in the database for postmortem analysis as to why the test failed.

To summarize, we want the tests to run in rollback mode as long as the test passes so that one test doesn't affect the other test and on the first failure of a test, commit the data at that point and stop.

We spend considerable amount of time investigating the integration test failure and would like to know if we have any option in grails to stop at first integration test failure with data preserved in the database for investigation. I searched little and didn't find any suitable pointers. If you follow any other practice to troubleshoot integration test and if it is worth sharing please let us know.

Answers


Simple hack you could try:

set a global flag on failure, test for the flag in each test. if flag is set exit the test


Recently I came across with Grails Guard Plugin and I think it can be useful in this case, because besides running integration tests faster, it preserves the data saved after tests are run.


Need Your Help

How do you get WPF to work like Forms at design time?

wpf controls resize

A bit new with WPF...It seems like not matter what I change with horizontal and vertical alignment, WPF has a mind of its own when resizing my controls in design time. I created a new Window, plac...

Sort list of objects with Jinja2 and Flask depending the field pressed

javascript python sorting flask jinja2

I have a model in Flask called Dog, with the parameters Name, Breed and Age. Through Jinja2 I show them in a template as follow: