Makefile: Target "unit_test_goveralls", run by Travis, outputs top 10 packages with

worst coverage at the end.
This commit is contained in:
Michael Berlin 2015-08-12 16:32:37 -07:00
Родитель 6f9458ced2
Коммит 615e002385
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -59,11 +59,15 @@ unit_test_race:
# Run coverage and upload to coveralls.io.
# Requires the secret COVERALLS_TOKEN env variable to be set.
unit_test_goveralls:
go list -f '{{if len .TestGoFiles}}godep go test $(VT_GO_PARALLEL) -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}{{end}}' ./go/... | xargs -i sh -c {}
go list -f '{{if len .TestGoFiles}}godep go test $(VT_GO_PARALLEL) -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}{{end}}' ./go/... | xargs -i sh -c {} | tee unit_test_goveralls.txt
gover ./go/
# -shallow ensures that goveralls does not return with a failure \
# if Coveralls returns a 500 http error or higher (e.g. when the site is in read-only mode). \
goveralls -shallow -coverprofile=gover.coverprofile -service=travis-ci
echo
echo "Top 10 of Go packages with worst coverage:"
sort -n -k 5 unit_test_goveralls.txt | head -n10
[ -f unit_test_goveralls.txt ] && rm unit_test_goveralls.txt
ENABLE_MEMCACHED := $(shell test -x /usr/bin/memcached && echo "-m")
queryservice_test_files = \