Merge pull request #148 from steveeJ/coverage-batches
travis & README: add coveralls coverage report
This commit is contained in:
commit
d497d6069a
@ -7,13 +7,18 @@ go:
|
|||||||
- 1.6
|
- 1.6
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- TOOLS_CMD=golang.org/x/tools/cmd
|
global:
|
||||||
|
- TOOLS_CMD=golang.org/x/tools/cmd
|
||||||
|
- PATH=$GOROOT/bin:$PATH
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- go get ${TOOLS_CMD}/vet
|
- go get ${TOOLS_CMD}/vet
|
||||||
|
- go get ${TOOLS_CMD}/cover
|
||||||
|
- go get github.com/modocache/gover
|
||||||
|
- go get github.com/mattn/goveralls
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sudo -E /bin/bash -c 'PATH=$GOROOT/bin:$PATH ./test'
|
- ./test
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
[](https://travis-ci.org/appc/cni)
|
[](https://travis-ci.org/appc/cni)
|
||||||
|
[](https://coveralls.io/github/appc/cni?branch=master)
|
||||||
|
|
||||||
# cni - the Container Network Interface
|
# cni - the Container Network Interface
|
||||||
|
|
||||||
|
19
test
19
test
@ -33,8 +33,23 @@ fi
|
|||||||
split=(${TEST// / })
|
split=(${TEST// / })
|
||||||
TEST=${split[@]/#/${REPO_PATH}/}
|
TEST=${split[@]/#/${REPO_PATH}/}
|
||||||
|
|
||||||
echo "Running tests..."
|
echo -n "Running tests "
|
||||||
go test ${COVER} $@ ${TEST}
|
function testrun {
|
||||||
|
sudo -E bash -c "umask 0; PATH=\$GOROOT/bin:\$PATH go test -covermode set $@"
|
||||||
|
}
|
||||||
|
if [ ! -z "${COVERALLS}" ]; then
|
||||||
|
echo "with coverage profile generation..."
|
||||||
|
i=0
|
||||||
|
for t in ${TEST}; do
|
||||||
|
testrun "-coverprofile ${i}.coverprofile ${t}"
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
gover
|
||||||
|
goveralls -service=travis-ci -coverprofile=gover.coverprofile -repotoken=$COVERALLS_TOKEN
|
||||||
|
else
|
||||||
|
echo "without coverage profile generation..."
|
||||||
|
testrun "${TEST}"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Checking gofmt..."
|
echo "Checking gofmt..."
|
||||||
fmtRes=$(gofmt -l $FMT)
|
fmtRes=$(gofmt -l $FMT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user