[Rails] *dont* empty the database...?
Alex Young
alex at blackkettle.org
Fri Apr 7 10:49:10 GMT 2006
Alan Bullock wrote:
> I'd like to test against a very large dataset - is there anyway to prevent
> the data in the test database being destroyed on each test run? storing the
> dataset in fixtures causes the tests to take several minutes to complete,
> even using csv fixtures, and that's just for one test case!
>
> I'd appreciate any suggestions on how to preserve the data in the test database
> between test runs
Which DB are you using? If it's got a nice self-contained file-based
store (like sqlite) you could stop the DB and swap the test data in from
a backup each test run. That way there's no fixture load overhead, but
you'd need to customise the rake task if you want it fully automated...
There may well be a better way, but for the moment it escapes me.
--
Alex
More information about the Rails
mailing list