alphagov/limelight — pull request #202 by abersager (2013-09-16 13:18:09+00:00)
Title: Enable execution of feature tests through Saucelabs

All features can now be run through Sauce, although there are intermittent failures. Specs and features through Capybara continue to run normally as before.

We are only using Saucelabs on master builds, in order to keep the feedback cycle short. Even on master, only scenarios that are tagged with `@sauce` are run through Saucelabs. This is because current features take too long to run, causing a timeout on Travis. Instead, we should create special 'journey' tests, which are designed to run through Sauce.

Various stubbing methods have been unified, the only place to specify stubs now is backdrop stub controller. This means that when opening a page that causes Rails to request data from Backdrop, the Rails process is now sending an HTTP request to itself.

During test, this problem is circumvented by using the `threadsafe!` option. However, when using 'bowl limelight' with stub APIs, requests from Rails to Backdrop are failing. This is because unicorn seems to run with one worker by default. The single thread is already blocked with rendering the page and no worker is available to answer the stubbed request to Backdrop. In order to solve this, a unicorn config file needs to be specified that spins up more than one worker. This needs to be fixed in github.com/alphagov/development.