milvus/scripts/run_go_codecov.sh
groot 69d683c693
Update codecov api to v2 (#8471)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
2021-09-24 16:41:55 +08:00

15 lines
381 B
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "mode: atomic" > go_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 >> go_coverage.txt
rm profile.out
fi
done
go tool cover -html=./go_coverage.txt -o ./go_coverage.html