Current pipeline uses the global wmfgrunt slave-script:
* [/bin/wmfgrunt](https://github.com/wikimedia/integration-jenkins/blob/0b85d48e60/bin/wmfgrunt)
* [/tools/Gruntfile.js](https://github.com/wikimedia/integration-jenkins/blob/0b85d48e60/tools/Gruntfile.js)

Fetch integration-jenkins.git to test it. As dependencies are pre-compiled and committed to git for Ubuntu Precise, on other platforms, first `cd ./tools; rm -rf node_modules` and `npm install` to provide for your system's architecture.

It's invoked from this macro: https://github.com/wikimedia/integration-config/blob/0b85d48e60/jjb/macro.yaml#L344


For many reasons, we should migrate from grunt-contrib-qunit to Karma, and use Chromium and/or Firefox as browser instead of PhantomJS:
* Performance. Chromium is faster.
* Accuracy.  PhantomJS is not a browser we support. Its layout and JavaScript engine and version thereof are irrelevant. It's based on a port from an old Safari build. Aside from being old it's also customised and under various abstraction layers. Ideally we'd run in multiple browsers, but even one would be a great start. PhantomJS does support nice features most browsers can't or wont implement, but those are not features we need to run unit tests. We want a real browser.
* Ability. While testing fallback behaviour is important, many new browser features are unavailable in PhantomJS. This is actively making it impossible to run tests against modern code such as from OOjs UI and VisualEditor that don't support Safari 4 or 5.

https://github.com/karma-runner/karma
https://github.com/karma-runner/karma-chrome-launcher
https://github.com/karma-runner/karma-qunit
https://github.com/karma-runner/grunt-karma

This is already being used by OOjs, OOjs UI and VisualEditor standalone. This task is about migrating the pipeline for projects that rely on running in a MediaWiki context. This brings many complexities due to registering and loading of scripts. As well as migrating the bootstrapping code to support Ubuntu Trusty and labs instances (as opposed to prod slavs running Precise).