diff --git a/circle.yml b/circle.yml index de49c473..decf14f9 100644 --- a/circle.yml +++ b/circle.yml @@ -31,4 +31,6 @@ test: override: - "cd $REPO && make test_integrations" post: - - bash <(curl -s https://codecov.io/bash) + - "cd $REPO && bash <(curl -s https://codecov.io/bash)" + + diff --git a/test/run_test.sh b/test/run_test.sh index 90e8f502..9ef4388f 100644 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -6,8 +6,7 @@ echo `pwd` BRANCH=`git rev-parse --abbrev-ref HEAD` echo "Current branch: $BRANCH" -# go test --race github.com/tendermint/tendermint/... -make test_race +bash test/test_cover.sh # run the app tests bash test/app/test.sh diff --git a/test/test.sh b/test/test.sh index 6e292590..dc50501e 100644 --- a/test/test.sh +++ b/test/test.sh @@ -10,7 +10,10 @@ bash ./test/docker/build.sh echo "" echo "* running go tests and app tests in docker container" -docker run -t tester bash test/run_test.sh +docker run --name run_test -t tester bash test/run_test.sh + +# copy the coverage results out of docker container +docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt . # test basic network connectivity # by starting a local testnet and checking peers connect and make blocks diff --git a/test/test_cover.sh b/test/test_cover.sh new file mode 100644 index 00000000..52d45dc5 --- /dev/null +++ b/test/test_cover.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +PKGS=$(go list github.com/tendermint/tendermint/... | grep -v /vendor/) + +set -e +echo "mode: atomic" > coverage.txt +for pkg in ${PKGS[@]}; do + go test -race -coverprofile=profile.out -covermode=atomic $pkg + if [ -f profile.out ]; then + tail -n +2 profile.out >> coverage.txt; + rm profile.out + fi +done