Setting up the Qunit task for use with Jenkins

roblarsen edited this page Jan 29, 2013 · 3 revisions

Based on the work done in #60 we have this:

  1. Install phantomjs ( in your build/tools
  2. Install the Phantom QUnit Runner script ( in you build tools folder
  3. drop the qunit script in you build tools folder
  4. update the following properties in
# the path to your phantomjs binary. It should live in ${}
 tool.phantomJS = phantomjs-1.8.1-windows/phantomjs.exe
# the name of your qunit.js file for PhantomJS
 tool.qunit.js = qunit-1.11.0.js
#the location of qunit-runner for PhantomJS
 tool.qunitrunner.js = qunit-runner.js
# the location of your tests
 dir.tests           = tests
  1. Add the qunit task to whichever flavor of build you commonly run, for example, to add it to the default do:
    <target name="-build.production"
  1. Configure Jenkins to use our newly enhanced task (this example would just be ant build since it's the default.)

  2. Point Jenkins to the JUnit-style output XML file

The assumption is that you will have the wherewithal to move these things around and to edit the qunit task itself. This is a functional example of one way it can work.

    <target name="qunit" description="runs QUnit tests using PhantomJS">
      <apply executable="${basedir}/${}/${tool.phantomJS}" >
        <fileset dir="${dir.tests}"/>
        <arg value="${basedir}/${}/${tool.qunitrunner.js}" />
        <arg value="--qunit"/>
        <arg path="${basedir}/${}/${tool.qunit.js}" />
        <arg value="--tests"/>
        <arg path="${dir.tests}" />
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.