This repository has been archived by the owner on Nov 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 202
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:
- Install phantomjs (http://phantomjs.org/) in your build/tools
- Install the Phantom QUnit Runner script (https://gist.github.com/1588423) in you build tools folder
- drop the qunit script in you build tools folder
- update the following properties in project.properties
# https://github.com/h5bp/ant-build-script/wiki/Setting-up-the-Qunit-task-for-use-with-Jenkins
# the path to your phantomjs binary. It should live in ${dir.build.tools}
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
- 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"
depends="-intro,
-usemin,
-js.all.minify,
-js.main.concat,
-js.scripts.concat,
-css,
-htmlclean,
-imagespng,
-imagesjpg,
-copy,
-jsdoc3,
-qunit"/>
-
Configure Jenkins to use our newly enhanced task (this example would just be
ant build
since it's the default.) -
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}/${dir.build.tools}/${tool.phantomJS}" >
<fileset dir="${dir.tests}"/>
<arg value="${basedir}/${dir.build.tools}/${tool.qunitrunner.js}" />
<arg value="--qunit"/>
<arg path="${basedir}/${dir.build.tools}/${tool.qunit.js}" />
<arg value="--tests"/>
<arg path="${dir.tests}" />
<srcfile/>
</apply>
</target>