From 7a78f4870a46e301cab28d0c6734308093ee1cca Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 22 Apr 2015 16:33:44 +1000 Subject: [PATCH 1/3] Use phantomjs for js specs, so we can run them in CI --- config/ng-test.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ng-test.conf.js b/config/ng-test.conf.js index f87aa3d48a..0456d5eb88 100644 --- a/config/ng-test.conf.js +++ b/config/ng-test.conf.js @@ -42,7 +42,7 @@ module.exports = function(config) { autoWatch: true, - browsers: ['Chrome'], + browsers: ['PhantomJS'], junitReporter: { outputFile: 'log/testacular-unit.xml', From 7aeeb6d18feb760bdbe2efb829fec874d5b10a0c Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 22 Apr 2015 16:36:31 +1000 Subject: [PATCH 2/3] Add script to run JS specs in CI --- script/ci/run_js_tests.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 script/ci/run_js_tests.sh diff --git a/script/ci/run_js_tests.sh b/script/ci/run_js_tests.sh new file mode 100755 index 0000000000..91a4be09d9 --- /dev/null +++ b/script/ci/run_js_tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +echo "--- Loading environment" +source ./script/ci/includes.sh +load_environment + +echo "--- Verifying branch is based on current master" +exit_unless_master_merged + +echo "--- Bundling" +bundle install + +echo "--- Running tests" +bundle exec rake karma:run From 92e03e208f9d55e085ff09900517c02785776e4a Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 22 Apr 2015 15:53:54 +1000 Subject: [PATCH 3/3] Extract load_environment method --- script/ci/includes.sh | 7 +++++++ script/ci/run_tests.sh | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/script/ci/includes.sh b/script/ci/includes.sh index 06713fc773..4b07dacfdc 100644 --- a/script/ci/includes.sh +++ b/script/ci/includes.sh @@ -1,3 +1,10 @@ +function load_environment { + source /var/lib/jenkins/.rvm/environments/ruby-1.9.3-p392 + if [ ! -f config/application.yml ]; then + ln -s application.yml.example config/application.yml + fi +} + function exit_unless_master_merged { if [[ `git branch -a --merged origin/$BUILDKITE_BRANCH` != *origin/master* ]]; then echo "This branch does not have the current master merged. Please merge master and push again." diff --git a/script/ci/run_tests.sh b/script/ci/run_tests.sh index 9fdbd11333..189875f1e1 100755 --- a/script/ci/run_tests.sh +++ b/script/ci/run_tests.sh @@ -4,10 +4,7 @@ set -e echo "--- Loading environment" source ./script/ci/includes.sh -source /var/lib/jenkins/.rvm/environments/ruby-1.9.3-p392 -if [ ! -f config/application.yml ]; then - ln -s application.yml.example config/application.yml -fi +load_environment echo "--- Verifying branch is based on current master" exit_unless_master_merged