Our Capybara tests can run on PhantomJS and on Selenium. I want to have a situation when
master branch builds run them on Selenium
staging / feature branches builds run them on Phantom JS
I can do that by setting environment variable CAPYBARA_DRIVER. However, I don’t know how to set this variable conditionally (by checking CIRCLE_BRANCH). What I tried is this
But it of course doesn’t work (since rake test:subset is inside case). I don’t want to use test:post because I want to use Circle CI’s method of distributing tests across nodes.
Partially. We kick of nightly builds on master using API. We scheduled this script to run at the same time everyday and it’s passing name of driver in build parameters