From 3623ed4483132b1b38bfa3efe493124fa554bd77 Mon Sep 17 00:00:00 2001 From: Sagar Muchhal Date: Thu, 4 Jan 2024 15:33:52 -0800 Subject: [PATCH] temp commit --- hack/test-unit.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/test-unit.sh b/hack/test-unit.sh index 2ace34222..0eb0be52b 100755 --- a/hack/test-unit.sh +++ b/hack/test-unit.sh @@ -98,8 +98,13 @@ go test "${GO_TEST_FLAGS_NORACE[@]+"${GO_TEST_FLAGS_NORACE[@]}"}" \ # Merge the race/norace code coverage files. if [ -n "${COVERAGE_FILE:-}" ]; then + # Removing coverage for generated code + TMP_API_COVERAGE_FILE="$(mktemp)" + mv "${API_COVERAGE_FILE}" "${TMP_API_COVERAGE_FILE}" + cat "${TMP_API_COVERAGE_FILE}" | grep -v "zz_generated*" > "${API_COVERAGE_FILE}" + TMP_COVERAGE_FILE="$(mktemp)" mv "${COVERAGE_FILE}" "${TMP_COVERAGE_FILE}" gocovmerge "${API_COVERAGE_FILE}" "${TMP_COVERAGE_FILE}" "${COVERAGE_FILE_NORACE}" >"${COVERAGE_FILE}" - rm -f "${API_COVERAGE_FILE}" "${TMP_COVERAGE_FILE}" "${COVERAGE_FILE_NORACE}" + rm -f "${API_COVERAGE_FILE}" "${TMP_API_COVERAGE_FILE}" "${TMP_COVERAGE_FILE}" "${COVERAGE_FILE_NORACE}" fi