Browse Source

test: codecov

pull/279/head
Ethan Buchman 8 years ago
parent
commit
a1649f774e
4 changed files with 21 additions and 4 deletions
  1. +3
    -1
      circle.yml
  2. +1
    -2
      test/run_test.sh
  3. +4
    -1
      test/test.sh
  4. +13
    -0
      test/test_cover.sh

+ 3
- 1
circle.yml View File

@ -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)"

+ 1
- 2
test/run_test.sh View File

@ -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


+ 4
- 1
test/test.sh View File

@ -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


+ 13
- 0
test/test_cover.sh View File

@ -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

Loading…
Cancel
Save