forked from cerc-io/plugeth
Merge pull request #1683 from ethereum/travis
Switch from Coveralls to Codecov code coverage service
This commit is contained in:
commit
0737cbc5c1
@ -5,7 +5,7 @@ install:
|
|||||||
# - go get code.google.com/p/go.tools/cmd/goimports
|
# - go get code.google.com/p/go.tools/cmd/goimports
|
||||||
# - go get github.com/golang/lint/golint
|
# - go get github.com/golang/lint/golint
|
||||||
# - go get golang.org/x/tools/cmd/vet
|
# - go get golang.org/x/tools/cmd/vet
|
||||||
- go get golang.org/x/tools/cmd/cover github.com/mattn/goveralls
|
- go get golang.org/x/tools/cmd/cover
|
||||||
before_script:
|
before_script:
|
||||||
# - gofmt -l -w .
|
# - gofmt -l -w .
|
||||||
# - goimports -l -w .
|
# - goimports -l -w .
|
||||||
@ -15,7 +15,7 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- make travis-test-with-coverage
|
- make travis-test-with-coverage
|
||||||
after_success:
|
after_success:
|
||||||
- if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="
|
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="
|
||||||
|
@ -1,26 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# This script runs all package tests and merges the resulting coverage
|
|
||||||
# profiles. Coverage is accounted per package under test.
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
echo "" > coverage.txt
|
||||||
|
|
||||||
if [ ! -f "build/env.sh" ]; then
|
for d in $(find ./* -maxdepth 10 -type d -not -path "./build" -not -path "./Godeps/*" ); do
|
||||||
echo "$0 must be run from the root of the repository."
|
if ls $d/*.go &> /dev/null; then
|
||||||
exit 2
|
go test -coverprofile=profile.out -covermode=atomic $d
|
||||||
fi
|
if [ -f profile.out ]; then
|
||||||
|
cat profile.out >> coverage.txt
|
||||||
echo "mode: count" > profile.cov
|
echo '<<<<<< EOF' >> coverage.txt
|
||||||
|
rm profile.out
|
||||||
for pkg in $(go list ./...); do
|
fi
|
||||||
# drop the namespace prefix.
|
|
||||||
dir=${pkg##github.com/ethereum/go-ethereum/}
|
|
||||||
|
|
||||||
if [[ $dir != "tests" ]]; then
|
|
||||||
go test -covermode=count -coverprofile=$dir/profile.tmp $pkg
|
|
||||||
fi
|
|
||||||
if [[ -f $dir/profile.tmp ]]; then
|
|
||||||
tail -n +2 $dir/profile.tmp >> profile.cov
|
|
||||||
rm $dir/profile.tmp
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user