I’m trying to build a simple performance test on a rails 3 app that operates
on a large database (~150GB). We copy production data to our dev/test setup
every night so that we have a realistic environment for development.
I followed the guide on creating a test and tried to run it using
$ rake test:benchmark
Unbelievably, this tried to drop my test database!!! Fortunately it didn’t
have permission to do this and failed.
Is there a way to skip this step and
just run the test against the DB as it exists already. From the guide, it
seems like most rails apps have their test data in yaml files or something
but I don’t understand how this would scale to a production environment.
Code that works well on 100 or so database rows is not necessarily going to
work well on millions of rows.
The test environment is designed for testing that stuff works, not for
If this is true, someone should tell that to the official guide maintainers
The test environment is not appropriate for performance testing
anyway, to do this you would have to set up a parallel production
environment in order that it correctly mimics your real environment.
Exactly! We have this. I just wondered if there was a “rails/ruby way” of writing and running performance tests against this environment. The scaffolding builds a tests/performance directory so I assumed there was.