From cf0d85b7f4fe9c195230552808a26a03f77edee1 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sun, 26 Aug 2018 16:10:07 +0000 Subject: [PATCH] Run coverage as part of integration test job This lets it run at the same time as GCE VMs are deleted, and saves us having to run up another job just for coverage. --- .circleci/config.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 081bf5a04..acb0ddef6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,10 +34,6 @@ workflows: - lint - unit-test - build - - gen-coverage: - requires: - - unit-test - - integration-tests - deploy: filters: branches: @@ -130,6 +126,7 @@ jobs: SRCDIR: /home/circleci/src/github.com/weaveworks/scope CIRCLE_ARTIFACTS: /tmp/artifacts CLOUDSDK_CORE_DISABLE_PROMPTS: 1 + GOPATH: /home/circleci/ parallelism: 2 steps: - checkout @@ -139,6 +136,7 @@ jobs: sudo apt-get update sudo apt-get install python-pip jq pv sudo pip install awscli + - run: mkdir $CIRCLE_ARTIFACTS # kick off creation of test VMs - run: test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD" - run: test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh make_template) @@ -151,20 +149,7 @@ jobs: - run: command: test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh destroy) background: true - - persist_to_workspace: - root: . - paths: - - coverage - - gen-coverage: - <<: *defaults - environment: - CIRCLE_ARTIFACTS: /tmp/artifacts - steps: - - checkout - - run: mkdir $CIRCLE_ARTIFACTS - - attach_workspace: - at: . + # Code coverage - run: ./tools/cover/gather_coverage.sh ./coverage $SRCDIR/coverage - run: goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=profile.cov -service=circleci - run: cp coverage.* */*.codecgen.go $CIRCLE_ARTIFACTS