From 5dd593849b798e2847bd8dd139dfa340b044fec7 Mon Sep 17 00:00:00 2001 From: Prabhat Sharma Date: Wed, 18 May 2022 04:54:32 -0700 Subject: [PATCH] fixed coverage to work in linux --- coverage.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/coverage.sh b/coverage.sh index b9f576f2c..4e08ff1ac 100755 --- a/coverage.sh +++ b/coverage.sh @@ -3,8 +3,8 @@ export ZINC_FIRST_ADMIN_USER=admin export ZINC_FIRST_ADMIN_PASSWORD=Complexpass#123 -find ./pkg -name data -type dir|xargs rm -fR -find ./test -name data -type dir|xargs rm -fR +find ./pkg -name data -type d|xargs rm -fR +find ./test -name data -type d|xargs rm -fR go test ./... -race -covermode=atomic -coverprofile=coverage.out @@ -16,13 +16,13 @@ go test ./... -race -covermode=atomic -coverprofile=coverage.out # Example setup https://github.com/lluuiissoo/go-testcoverage/blob/main/.github/workflows/ci.yml # enable threshold -COVERAGE_THRESHOLD=20 +COVERAGE_THRESHOLD=81 totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]'` # clean up -find ./pkg -name data -type dir|xargs rm -fR -find ./test -name data -type dir|xargs rm -fR +find ./pkg -name data -type d|xargs rm -fR +find ./test -name data -type d|xargs rm -fR rm coverage.out # clean up finished