mirror of
https://github.com/rancher/plugins.git
synced 2025-08-31 21:16:19 +00:00
travis & README: add coveralls coverage report
Also, don't use sudo for the entire test script
This commit is contained in:
19
test
19
test
@@ -33,8 +33,23 @@ fi
|
||||
split=(${TEST// / })
|
||||
TEST=${split[@]/#/${REPO_PATH}/}
|
||||
|
||||
echo "Running tests..."
|
||||
go test ${COVER} $@ ${TEST}
|
||||
echo -n "Running tests "
|
||||
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..."
|
||||
fmtRes=$(gofmt -l $FMT)
|
||||
|
Reference in New Issue
Block a user