From 94af9ec47d27f9d3ab5315b1caf9b7ba0a802e61 Mon Sep 17 00:00:00 2001 From: groot Date: Sun, 3 Oct 2021 17:48:10 +0800 Subject: [PATCH] [skip ci] Add description to coverage script (#9138) Signed-off-by: Yihua Co-authored-by: Yihua --- scripts/run_go_codecov.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/run_go_codecov.sh b/scripts/run_go_codecov.sh index 872f02fc17..bc1301ab7e 100755 --- a/scripts/run_go_codecov.sh +++ b/scripts/run_go_codecov.sh @@ -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}"