at file:///workspace/superlists/superlists/static/tests/qunit.js:203
at file:///workspace/superlists/superlists/static/tests/qunit.js:361
at process
(file:///workspace/superlists/superlists/static/tests/qunit.js:1453)
at file:///workspace/superlists/superlists/static/tests/qunit.js:479
Took 27ms to run 2 tests. 1 passed, 1 failed.
All right! Let’s unbreak that, commit and push the runner, and then add it to our Jenkins
build:
$
git checkout lists/static/list.js
$
git add superlists/static/tests/runner.js
$
git commit -m"Add phantomjs test runner for javascript tests"
$
git push
Adding the Build Steps to Jenkins
Edit the project configuration again, and add a step for each set of JavaScript tests, as
per
Figure 20-12 .Figure 20-12. Add a build step for our JavaScript unit tests
You’ll also need to install PhantomJS on the server:
elspeth@server:$
sudo add-apt-repository -y
ppa:chris-lea/node.js elspeth@server:$
sudo apt-get update
elspeth@server:$
sudo apt-get install nodejs
elspeth@server:$
sudo npm install -g phantomjs
And there we are! A complete CI build featuring all of our tests!
Started by user harry
Building in workspace /var/lib/jenkins/jobs/Superlists/workspace
Fetching changes from the remote Git repository
Fetching upstream changes from
https://github.com/hjwp/book-example.gitChecking out Revision 936a484038194b289312ff62f10d24e6a054fb29 (origin/chapter_1
Xvfb starting$ /usr/bin/Xvfb :1 -screen 0 1024x768x24 -fbdir /var/lib/jenkins/20
[workspace] $ /bin/sh -xe /tmp/shiningpanda7092102504259037999.sh
+ pip install -r requirements.txt
Running Our QUnit JavaScript Tests in Jenkins with PhantomJS
|
383