Run coverage analysis in separate step, and save results
Remove CircleCI 1.0 implementation which used scp to contact other lanes. Note we can't use an env var in store_artifacts clause
This commit is contained in:
1 parent
e3576e13a7
commit
1a8794e90f
4 files changed
+29
-22
No files matched your search
+28
-6
@@ -1,7 +1,7 @@
|
|||||||
version: 2
|
version: 2
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
docker:
|
docker:
|
||||||
- image: weaveworks/weavebuild:circle20-50a4e941
|
- image: weaveworks/weavebuild:circle20-2e6504d3
|
||||||
working_directory: /go/src/github.com/weaveworks/weave
|
working_directory: /go/src/github.com/weaveworks/weave
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -18,6 +18,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: COVERDIR=test/coverage make BUILD_IN_CONTAINER=false tests
|
- run: COVERDIR=test/coverage make BUILD_IN_CONTAINER=false tests
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: .
|
||||||
|
paths:
|
||||||
|
- test/coverage
|
||||||
|
|
||||||
build:
|
build:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
@@ -62,11 +66,25 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: bin/circle-destroy-vms
|
command: bin/circle-destroy-vms
|
||||||
background: true
|
background: true
|
||||||
- deploy:
|
- persist_to_workspace:
|
||||||
command: cd $SRCDIR/test; ./gen_coverage_reports.sh
|
root: .
|
||||||
# run goveralls; copy coverage reports to artifacts dir
|
paths:
|
||||||
- deploy:
|
- test/coverage
|
||||||
command: $SRCDIR/bin/circle-teardown-pre
|
- store_artifacts:
|
||||||
|
path: /tmp/artifacts
|
||||||
|
|
||||||
|
gen-coverage:
|
||||||
|
<<: *defaults
|
||||||
|
environment:
|
||||||
|
CIRCLE_ARTIFACTS: /tmp/artifacts
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: mkdir $CIRCLE_ARTIFACTS
|
||||||
|
- attach_workspace:
|
||||||
|
at: .
|
||||||
|
- run: cd test; ./gen_coverage_reports.sh
|
||||||
|
- run: goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=test/profile.cov -service=circleci
|
||||||
|
- run: cp test/coverage.* $CIRCLE_ARTIFACTS
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: /tmp/artifacts
|
path: /tmp/artifacts
|
||||||
|
|
||||||
@@ -89,6 +107,10 @@ workflows:
|
|||||||
- lint
|
- lint
|
||||||
- unit-test
|
- unit-test
|
||||||
- build
|
- build
|
||||||
|
- gen-coverage:
|
||||||
|
requires:
|
||||||
|
- unit-test
|
||||||
|
- smoke-tests
|
||||||
- deploy:
|
- deploy:
|
||||||
requires:
|
requires:
|
||||||
- smoke-tests
|
- smoke-tests
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# avoid breaking the build on make lint:
|
# avoid breaking the build on make lint:
|
||||||
bin/circle-deploy-issues
|
bin/circle-deploy-issues
|
||||||
bin/circle-deploy-master
|
bin/circle-deploy-master
|
||||||
bin/circle-teardown-pre
|
|
||||||
bin/circle-test-teardown
|
bin/circle-test-teardown
|
||||||
bin/circle-test-unit
|
bin/circle-test-unit
|
||||||
bin/install-wordepress
|
bin/install-wordepress
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
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
|
|
||||||
@@ -3,13 +3,8 @@
|
|||||||
set -ex
|
set -ex
|
||||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
if [ -n "$CIRCLECI" ]; then
|
# 'cover' tool is from github.com/weaveworks/build-tools/cover
|
||||||
for i in $(seq 1 $(($CIRCLE_NODE_TOTAL - 1))); do
|
|
||||||
scp node$i:/home/ubuntu/src/github.com/weaveworks/weave/test/coverage/* ./coverage/ || true
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
go get github.com/weaveworks/build-tools/cover
|
|
||||||
cover ./coverage/* >profile.cov
|
cover ./coverage/* >profile.cov
|
||||||
go tool cover -html=profile.cov -o coverage.html
|
go tool cover -html=profile.cov -o coverage.html
|
||||||
go tool cover -func=profile.cov -o coverage.txt
|
go tool cover -func=profile.cov -o coverage.txt
|
||||||
|
|||||||
Reference in new issue
Block a user