From a9db631836fbef6eb8dca473cafe7dd97f93eb8e Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Tue, 10 May 2016 11:21:56 +0100 Subject: [PATCH] Add toggle for skipping tests --- bin/circle-dependencies-post | 19 ++++++++++++------- bin/circle-deploy-master | 10 ++++++---- bin/circle-teardown-pre | 10 ++++++---- bin/circle-test-override | 10 ++++++---- bin/circle-test-post | 8 +++++--- bin/circle-test-pre | 16 +++++++++------- 6 files changed, 44 insertions(+), 29 deletions(-) diff --git a/bin/circle-dependencies-post b/bin/circle-dependencies-post index 945a9dd7..028b7743 100755 --- a/bin/circle-dependencies-post +++ b/bin/circle-dependencies-post @@ -2,16 +2,21 @@ set -e +echo "SKIP_TESTS=1" > "$STATE" + source "$STATE" sudo apt-get -q update && sudo apt-get -q install bc jq bin/setup-circleci-secrets "$SECRET_PASSWORD" mkdir -p $(dirname $SRCDIR) && cp -r $(pwd)/ $SRCDIR -cd $SRCDIR; git submodule update --init -if [ "$CIRCLE_NODE_INDEX" = "0" ] ; then - cd $SRCDIR/test; ./gce.sh make_template + +if [ -z "$SKIP_TESTS" ] ; then + cd $SRCDIR; git submodule update --init + if [ "$CIRCLE_NODE_INDEX" = "0" ] ; then + cd $SRCDIR/test; ./gce.sh make_template + fi + cd $SRCDIR/build + ../tools/rebuild-image weaveworks/weavebuild . Dockerfile build.sh + touch $SRCDIR/.build.uptodate + sudo chown -R ubuntu /usr/local/go fi -cd $SRCDIR/build -../tools/rebuild-image weaveworks/weavebuild . Dockerfile build.sh -touch $SRCDIR/.build.uptodate -sudo chown -R ubuntu /usr/local/go diff --git a/bin/circle-deploy-master b/bin/circle-deploy-master index 44ad699f..2827ad91 100755 --- a/bin/circle-deploy-master +++ b/bin/circle-deploy-master @@ -4,10 +4,12 @@ set -e source "$STATE" -docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS -cd $SRCDIR -make clean-bin -make publish +if [ -z "$SKIP_TESTS" ] ; then + docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS + cd $SRCDIR + make clean-bin + make publish +fi go get github.com/weaveworks/wordepress cd /home/ubuntu/src/github.com/weaveworks/wordepress diff --git a/bin/circle-teardown-pre b/bin/circle-teardown-pre index f5d7a529..4670e3f1 100755 --- a/bin/circle-teardown-pre +++ b/bin/circle-teardown-pre @@ -4,8 +4,10 @@ set -e source "$STATE" -if [ "$CIRCLE_NODE_INDEX" = "0" ] ; then - go get github.com/mattn/goveralls - goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/test/profile.cov -service=circleci - cd $SRCDIR/test; cp coverage.* $CIRCLE_ARTIFACTS +if [ -z "$SKIP_TESTS" ] ; then + if [ "$CIRCLE_NODE_INDEX" = "0" ] ; then + go get github.com/mattn/goveralls + goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/test/profile.cov -service=circleci + cd $SRCDIR/test; cp coverage.* $CIRCLE_ARTIFACTS + fi fi diff --git a/bin/circle-test-override b/bin/circle-test-override index 4d25df4e..93aa9883 100755 --- a/bin/circle-test-override +++ b/bin/circle-test-override @@ -4,7 +4,9 @@ set -e source "$STATE" -cd $SRCDIR/test -eval $(./gce.sh hosts) -export COVERAGE=true -./run_all.sh +if [ -z "$SKIP_TESTS" ] ; then + cd $SRCDIR/test + eval $(./gce.sh hosts) + export COVERAGE=true + ./run_all.sh +fi diff --git a/bin/circle-test-post b/bin/circle-test-post index 38e14faf..dac2db4f 100755 --- a/bin/circle-test-post +++ b/bin/circle-test-post @@ -4,6 +4,8 @@ set -e source "$STATE" -cd $SRCDIR/test -./gce.sh destroy -test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR/test; ./gen_coverage_reports.sh) +if [ -z "$SKIP_TESTS" ] ; then + cd $SRCDIR/test + ./gce.sh destroy + test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR/test; ./gen_coverage_reports.sh) +fi diff --git a/bin/circle-test-pre b/bin/circle-test-pre index 3256fbdf..e019c3b6 100755 --- a/bin/circle-test-pre +++ b/bin/circle-test-pre @@ -4,11 +4,13 @@ set -e source "$STATE" -cd $SRCDIR -make lint -COVERDIR=test/coverage make RM= tests -make COVERAGE=true RM= all -make testrunner +if [ -z "$SKIP_TESTS" ] ; then + cd $SRCDIR + make lint + COVERDIR=test/coverage make RM= tests + make COVERAGE=true RM= all + make testrunner -cd $SRCDIR/test -./gce.sh setup && eval $(./gce.sh hosts) && ./setup.sh + cd $SRCDIR/test + ./gce.sh setup && eval $(./gce.sh hosts) && ./setup.sh +fi