views:

108

answers:

3

I am thinking of running my cucumber tests on my rails app when it is running on heroku. Is this a sane way to check for differences between development environment and deployment environment?

Does anybody have any experience of this kind of scenario? Rake -T tells me "cucumber rake task not available (cucumber not installed)" even though I have specified cucumber-rails in my .gems file. Am I approaching this from the wrong angle?

Any ideas or suggestions?

A: 

Is the cucumber gem also in your Gem manifest?

Michael Melanson
A: 

That would require the creation, modification and subsequent removal of a test database, and since Heroku ignores the database.yml file, this would not be possible at all.

You may try running your app in the testing environment by setting it in the console, and then you may be able to run tests

heroku config:add RACK_ENV=test

but even if you get this to work, say goodbye to your production database as I'm pretty sure Heroku will again override the database.yml and use the database it automatically assigned to your app.

You may also consider creating a second app on Heroku just for testing.

edgerunner
+2  A: 

You could use a seperate Heroku instance and deploy your app to there. You should then be able to run your tests via heroku rake.

You can use the --app parameter to the heroku command line to choose which instance to run commands on. Just dont delete your prod database by accident.

Ian Purton