Skip to content

Commit

Permalink
Have CircleCI run acceptance tests (voxpupuli#174).
Browse files Browse the repository at this point in the history
  • Loading branch information
dallinb committed Feb 20, 2016
1 parent 18c11e3 commit 94761ed
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
12 changes: 12 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ test:
override:
- ./scripts/circle.bash unit_tests:
parallel: true
- ./scripts/circle.bash acceptance_tests:
parallel: true

notify:
webhooks:
Expand All @@ -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
18 changes: 15 additions & 3 deletions scripts/circle.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -67,7 +82,6 @@ unit_tests () {
return $status
}

export BEAKER_set=""
export RVM=""

case $CIRCLE_NODE_INDEX in
Expand All @@ -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
Expand Down

0 comments on commit 94761ed

Please sign in to comment.