milvus/scripts/run_go_codecov.sh
groot 77e88144fc
Update code coverage script (#8280)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
2021-09-22 16:01:53 +08:00

15 lines
372 B
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "mode: atomic" > coverage.txt
for d in $(go list ./internal... | grep -v vendor); do
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic "$d"
if [ -f profile.out ]; then
sed '1d' profile.out >> coverage.txt
rm profile.out
fi
done
go tool cover -html=./coverage.txt -o ./go_coverage.html