Forum: Ruby on Rails *dont* empty the database...?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alan B. (Guest)
on 2006-04-07 14:37
(Received via mailing list)
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

thanks
al
Mikkel B. (Guest)
on 2006-04-07 14:37
(Received via mailing list)
why would you need so much test data??
On Friday, April 07, 2006, at 10:34 AM, Alan B. wrote:
>thanks
>al
>
>_______________________________________________
>Rails mailing list
>removed_email_address@domain.invalid
>http://lists.rubyonrails.org/mailman/listinfo/rails


Mikkel B.

www.strongside.dk    - Football Portal(DK)
ting.minline.dk      - Buy Old Stuff!(DK)
Alex Y. (Guest)
on 2006-04-07 14:49
(Received via mailing list)
Alan B. 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.
Dick D. (Guest)
on 2006-04-07 14:55
(Received via mailing list)
On 07/04/06, Alex Y. <removed_email_address@domain.invalid> wrote:
> Alan B. 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!

Does your db support transactions? check test/test_helper.rb says

  self.use_transactional_fixtures = true


--
Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/
This topic is locked and can not be replied to.