Page MenuHomePhabricator

Implement QUnit support in continuous integration (via phantomjs)
Closed, ResolvedPublic

Description

Jenkins should run the QUnit tests for the project that is being committed to.


Version: unspecified
Severity: enhancement

Details

Reference
bz44050

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:20 AM
bzimport set Reference to bz44050.

This is being worked on by Timo as time allow (ccing him). The idea is to get a MediaWiki install to listen on http://localhost/change/patch (or similar) and run the QUnit tests under NodeJS.

https://gerrit.wikimedia.org/r/#/c/44164/ setup the virtual host

(In reply to comment #1)

This is being worked on by Timo as time allow (ccing him). The idea is to
get a
MediaWiki install to listen on http://localhost/change/patch (or similar) and
run the QUnit tests under NodeJS.

PhantomJS, not NodeJS. In NodeJS tests would fail horribly as the DOM API doesn't exist.

I have this working in Limn (https://github.com/wikimedia/limn/blob/master/test/phantom.runner.js is the relevant file, along with some very light scripting that invokes it from the command line). I'll lend a hand on this soon.

(In reply to comment #3)

I have this working in Limn
(https://github.com/wikimedia/limn/blob/master/test/phantom.runner.js is the
relevant file, along with some very light scripting that invokes it from the
command line). I'll lend a hand on this soon.

The running of phantomjs isn't a problem and we already have a script for that in place that does not involve a fixed timeout or polling of DOM (QUnit has an API, no need to poll anything). I recognise the script you linked and guess you didn't write this yourself, so I'm not reviewing the script you linked further.

What I'm working on is the procedure to install MediaWiki within Jenkins in a temporary Apache-served location and then pass the url to phantomjs/qunit. Using grunt as builder for these steps (instead of Ant).

(QUnit has an API, no need to poll anything). I recognise the script you
linked and guess you didn't write this yourself, so I'm not reviewing the
script you linked further.

Yep, borrowed this and didn't clean it up yet. We're using the API to report results in more detail, if that's useful:

https://github.com/wikimedia/limn/blob/master/test/index.co

What I'm working on is the procedure to install MediaWiki within Jenkins
in a temporary Apache-served location and then pass the url to phantomjs/qunit.

Have you tried using Ori's Vagrant method? https://github.com/atdt/wmf-vagrant

(In reply to comment #5)

(QUnit has an API, no need to poll anything). I recognise the script you
linked and guess you didn't write this yourself, so I'm not reviewing the
script you linked further.

Yep, borrowed this and didn't clean it up yet. We're using the API to report
results in more detail, if that's useful:

https://github.com/wikimedia/limn/blob/master/test/index.co

What I'm working on is the procedure to install MediaWiki within Jenkins
in a temporary Apache-served location and then pass the url to phantomjs/qunit.

Have you tried using Ori's Vagrant method?
https://github.com/atdt/wmf-vagrant

We are going to run the builds themselves (as opposed to individual tasks) in a VM in the near future (likely using Vagrant), but I don't see how that is other wise relevant to running qunit tests.

As long as there's a timeout on the tests being run, I don't think a VM is necessary.

(In reply to comment #7)

As long as there's a timeout on the tests being run, I don't think a VM is
necessary.

Exactly.

http://lists.wikimedia.org/pipermail/wikitech-l/2013-March/067208.html