From 04ea2b6f816c6ea82c9070b4b9b1cacbd22562d2 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Mar 2020 12:33:47 +0530 Subject: [PATCH] Fix issue in profile.cov profile.cov need to be created inside the _output directory. Signed-off-by: Madhu Rajanna --- scripts/test-go.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test-go.sh b/scripts/test-go.sh index de3ecd2fb..8cb1fb067 100755 --- a/scripts/test-go.sh +++ b/scripts/test-go.sh @@ -1,7 +1,7 @@ #!/bin/bash GOPACKAGES="$(go list ./... | grep -v vendor | grep -v e2e)" -COVERFILE="${GO_COVER_DIR}profile.cov" +COVERFILE="${GO_COVER_DIR}/profile.cov" # no special options, exec to go test w/ all pkgs if [[ ${TEST_EXITFIRST} != "yes" && -z ${TEST_COVERAGE} ]]; then @@ -13,17 +13,17 @@ fi # at at time if [[ ${TEST_COVERAGE} ]]; then GOTESTOPTS="-covermode=count -coverprofile=cover.out" - echo "mode: count" > "${COVERFILE}" + echo "mode: count" >"${COVERFILE}" fi failed=0 for gopackage in ${GOPACKAGES}; do echo "--- testing: ${gopackage} ---" # shellcheck disable=SC2086 - go test ${GOTESTOPTS} "${gopackage}" || ((failed+=1)) + go test ${GOTESTOPTS} "${gopackage}" || ((failed += 1)) if [[ -f cover.out ]]; then # Append to coverfile - grep -v "^mode: count" cover.out >> "${COVERFILE}" + grep -v "^mode: count" cover.out >>"${COVERFILE}" fi if [[ ${TEST_COVERAGE} = "stdout" && -f cover.out ]]; then go tool cover -func=cover.out