Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run cucumber tests on heroku

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?

like image 720
Felix Andersen Avatar asked Sep 10 '10 22:09

Felix Andersen


2 Answers

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.

like image 160
Ian Purton Avatar answered Sep 29 '22 23:09

Ian Purton


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.

like image 24
edgerunner Avatar answered Sep 29 '22 22:09

edgerunner