From 94761edf6c733c35aab9df103fd75a1a364b767e Mon Sep 17 00:00:00 2001 From: Ben Dalling Date: Sat, 20 Feb 2016 13:22:56 +0000 Subject: [PATCH] Have CircleCI run acceptance tests (#174). --- circle.yml | 12 ++++++++++++ scripts/circle.bash | 18 +++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/circle.yml b/circle.yml index 2ea8ddef..5fc598c1 100644 --- a/circle.yml +++ b/circle.yml @@ -4,6 +4,8 @@ test: override: - ./scripts/circle.bash unit_tests: parallel: true + - ./scripts/circle.bash acceptance_tests: + parallel: true notify: webhooks: @@ -12,8 +14,18 @@ notify: - url: https://webhooks.gitter.im/e/da8c065419a91983f0cf deployment: + bugfix: + branch: /^bugfix.*/ + commands: + - ./scripts/circle.bash merge release/patch + - ./scripts/circle.bash merge release/minor improvement: branch: /^improvement.*/ commands: - ./scripts/circle.bash merge release/patch - ./scripts/circle.bash merge release/minor + master: + branch: master + commands: + - ./scripts/circle.bash merge release/last + - ./scripts/circle.bash deploy diff --git a/scripts/circle.bash b/scripts/circle.bash index 76ac26c0..e2e65df1 100755 --- a/scripts/circle.bash +++ b/scripts/circle.bash @@ -7,6 +7,21 @@ [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" export PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH +acceptance_tests () { + i=0 + nodes=() + + for node in $( bundle exec rake beaker_nodes | grep '^circle' ) ; do + if [ $(($i % $CIRCLE_NODE_TOTAL)) -eq $CIRCLE_NODE_INDEX ]; then + nodes+=" $node" + fi + + ((i=i+1)) + done + + echo "Nodes: $nodes" +} + merge () { if [ "$CIRCLE_NODE_INDEX" != 0 ]; then echo "Not on the primary Circle node. Skipping merge." @@ -67,7 +82,6 @@ unit_tests () { return $status } -export BEAKER_set="" export RVM="" case $CIRCLE_NODE_INDEX in @@ -81,8 +95,6 @@ case $CIRCLE_NODE_INDEX in export PUPPET_GEM_VERSION="~> 4.0" export STRICT_VARIABLES="yes" ;; - 3) export BEAKER_NODES="debian7 ubuntu12.04 ubuntu14.04" - ;; esac subcommand=$1