views:

278

answers:

2

I would like to performance testing a Rails app.

The real world data is 100 MB in size.

But Rails always rebuilds the test database, which overwrites the real world data.

So how to the performance testing?

+8  A: 

I would create a new environment called "performance". You need this to replicate the production settings of your app (class caching, templates etc) and then load the database. In the past I have created a DB specifically for performance testing, created a rake task that executes the necessary migrations/loading and then called the rails performance script.

You can also turn the fixture behaviour off in your tests - depends on which test framework you are using.

I also found this useful post on Running Rails performance tests on real data that has some details on this approach.

Toby Hede
A: 

I have a quick fix for SQLite users.

In TestCase

def setup
  `cp db/development.sqlite3 db/test.sqlite3`
end
Cheng