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