Parallelise integration tests.

This commit is contained in:
Tom Wilkie committed 2015-05-07 19:03:59 +00:00
1 parent 8d1b161d4f
commit 28a2c0d8a9
3 files changed
+24 -7

No files matched your search

+10 -5
View File
@@ -32,9 +32,14 @@ dependencies:
test: test:
override: override:
- docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build - docker run -v /var/run/docker.sock:/run/docker.sock -v /home/ubuntu:/home/go weaveworks/weave-build:
- cd $SRCDIR/test; ./gce.sh setup parallel: true
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh - cd $SRCDIR/test; ./gce.sh setup:
- cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh parallel: true
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh:
parallel: true
- cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh:
parallel: true
post: post:
- cd $SRCDIR/test; ./gce.sh destroy - cd $SRCDIR/test; ./gce.sh destroy:
parallel: true
+1 -1
View File
@@ -15,7 +15,7 @@ ZONE=us-central1-a
NUM_HOSTS=2 NUM_HOSTS=2
SUFFIX="" SUFFIX=""
if [ -n "$CIRCLECI" ]; then if [ -n "$CIRCLECI" ]; then
SUFFIX="-${CIRCLE_BUILD_NUM}" SUFFIX="-${CIRCLE_BUILD_NUM}-$CIRCLE_NODE_INDEX"
fi fi
# Setup authentication # Setup authentication
+13 -1
View File
@@ -24,7 +24,19 @@ check_test_status() {
# Overwrite assert.sh _assert_cleanup trap with our own # Overwrite assert.sh _assert_cleanup trap with our own
trap check_test_status EXIT trap check_test_status EXIT
for t in *_test.sh; do # If running on circle, only run the tests for my "shard".
# CIRCLE_NODE_TOTAL is the total number of shards, and
# CIRCLE_NODE_INDEX is my index.
i=0
TESTS=
for test in *_test.sh; do
if [ -z "$CIRCLECI" ] || [ $(($i % $CIRCLE_NODE_TOTAL)) -eq $CIRCLE_NODE_INDEX ]; then
TESTS="$TESTS $test"
fi
i=$(($i + 1))
done
for t in $TESTS; do
echo echo
greyly echo "---= Running $t =---" greyly echo "---= Running $t =---"
. $t . $t