Running tests in a different environment

Hi,

We have a continuous integration server setup for our rails projects.
I would like to set-up a different rails environment for running the
tests on the build server so that I don’t have to force all the
developers to set-up their local databases to match the build box’s
connection information. However, when do something like:

rake RAILS_ENV=build test:units

It still tries to use the db connection information from the test
environment. I think this must be hardcoded somewhere.

Is there a way to get the test tasks to run with a different rails
environment?

On Feb 25, 4:56 pm, byron appelt [email protected] wrote:

It still tries to use the db connection information from the test
environment. I think this must be hardcoded somewhere.

Take a peak at the first line of test_helper.rb :slight_smile:

Fred

On Feb 25, 10:56 am, byron appelt [email protected] wrote:

It still tries to use the db connection information from the test
environment. I think this must be hardcoded somewhere.

Is there a way to get the test tasks to run with a different rails
environment?

It would be better to not share the database.yml at all. That way,
you can define what the “test” environment means for the ci server
independently of the developers.

I think it’s better practice to not store the database.yml in source
control anyway, since it has passwords that you may not want to store
in source control.

Jeff

Take a peak at the first line of test_helper.rb :slight_smile:

I saw that, but it seems to not be the only place it is hardcoded
since even with that line commented it tries to acees the test
database.