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