[skip ci] Add description to coverage script (#9138)

Signed-off-by: Yihua <michaelmo@YihuadeMacBook-Pro.local>

Co-authored-by: Yihua <michaelmo@YihuadeMacBook-Pro.local>
pull/9143/head
groot 2021-10-03 17:48:10 +08:00 committed by GitHub
parent 9600407f83
commit 94af9ec47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ FILE_COVERAGE_HTML="go_coverage.html"
set -e
echo "mode: atomic" > ${FILE_COVERAGE_INFO}
# run unittest
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
@ -14,5 +15,6 @@ for d in $(go list ./internal... | grep -v vendor); do
fi
done
# generate html report
go tool cover -html=./${FILE_COVERAGE_INFO} -o ./${FILE_COVERAGE_HTML}
echo "Export go coverage report to ${FILE_COVERAGE_HTML}"