Files
nats-server/scripts/cov.sh
Ivan Kozlovic d154d646d4 Run coverage, but push to coverall only after_success
This will ensure that we get the matrix run green before pushing
results to coveralls, but also that if for some reason coveralls
has a problem, this is not making our build status red.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-09-20 12:02:14 -06:00

24 lines
801 B
Bash
Executable File

#!/bin/bash -e
# Run from directory above via ./scripts/cov.sh
export GO111MODULE="off"
go get github.com/mattn/goveralls
go get github.com/wadey/gocovmerge
rm -rf ./cov
mkdir cov
go test -v -failfast -covermode=atomic -coverprofile=./cov/conf.out ./conf
go test -v -failfast -covermode=atomic -coverprofile=./cov/log.out ./logger
go test -v -failfast -covermode=atomic -coverprofile=./cov/server.out ./server
go test -v -failfast -covermode=atomic -coverprofile=./cov/test.out -coverpkg=./server ./test
gocovmerge ./cov/*.out > acc.out
rm -rf ./cov
# Without argument, launch browser results. We are going to push to coveralls only
# from Travis.yml and after success of the build (and result of pushing will not affect
# build result).
if [[ $1 == "" ]]; then
go tool cover -html=acc.out
fi