Reading/Browser tests/Setting up a browser test bot

This documents the steps required to get a bot running browser tests and posting test results to Gerrit. There is more information on wikitech-l. Note: this reviews any patches which do not have the browser bot attached to them. You can trigger a new review by removing the browser bot from the patchset.
 * Acquire a Gerrit account e.g. Barrythebrowsertestbot
 * Acquire a labs project
 * Create a labs instance with mediawiki
 * ssh into your instance e.g. ssh gather-browser-tests.eqiad.wmflabs
 * Install any extensions you want to test into the mediawiki install. It's likely you'll also need to install the vector skin.
 * Install phantomjs
 * Install Ruby (apt-get install ruby-dev && gem install bundler)
 * Install git review
 * Get barrybot.py from BarryTheBrowserTestBot
 * Register a public key with Gerrit and your labs instance.
 * Create a mediawiki account on your machine for your tests e.g. "User:Mr Selenium"
 * Update ~/.profile with information specific to your machine.
 * Navigate to the extension you want to run browser tests for and set up the browser test environment. Ensure the tests are passing green. Note that some extensions e.g. MobileFrontend require additional setup steps.
 * Run a trial run of the BarryTheBrowserTestBot without the --review flag
 * Set up a background task script and watch it review away.

Background task sample code
Run this in the background to start reviewing!: