From db427eec38495da3a8e238a54c4771cc411ee181 Mon Sep 17 00:00:00 2001 From: Matheus Calegaro Date: Wed, 26 Jun 2024 16:02:12 -0300 Subject: [PATCH] chore(scripts/test): correct mocks path to ignore, add cleanup function --- .covignore | 4 ---- scripts/test.sh | 11 +++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) delete mode 100755 .covignore diff --git a/.covignore b/.covignore deleted file mode 100755 index 30f88fe..0000000 --- a/.covignore +++ /dev/null @@ -1,4 +0,0 @@ -tmp/* -bin/* -config/* -internal/pkg/mocks/* diff --git a/scripts/test.sh b/scripts/test.sh index 8804f04..cc0bd72 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,6 +1,14 @@ #!/bin/sh set -e + +cleanup() { + rm -f coverage.txt coverage.tmp profile.out +} + +trap cleanup EXIT + +cleanup echo "mode: set" > coverage.tmp for d in $(go list ./... | grep -v vendor); do @@ -12,7 +20,6 @@ for d in $(go list ./... | grep -v vendor); do fi done -cat coverage.tmp | grep -v "/internal/pkg/mocks" > coverage.txt -rm coverage.tmp +cat coverage.tmp | grep -v "/internal/tests/mocks" > coverage.txt go tool cover -html=coverage.txt