diff --git a/scripts/test-go.sh b/scripts/test-go.sh index 8cb1fb067..9a567c68d 100755 --- a/scripts/test-go.sh +++ b/scripts/test-go.sh @@ -1,12 +1,12 @@ #!/bin/bash -GOPACKAGES="$(go list ./... | grep -v vendor | grep -v e2e)" +GOPACKAGES="$(go list -mod=vendor ./... | grep -v -e vendor -e e2e)" COVERFILE="${GO_COVER_DIR}/profile.cov" # no special options, exec to go test w/ all pkgs if [[ ${TEST_EXITFIRST} != "yes" && -z ${TEST_COVERAGE} ]]; then # shellcheck disable=SC2086 - exec go test ${GOPACKAGES} + exec go test -mod=vendor -v ${GOPACKAGES} fi # our options are set so we need to handle each go package one @@ -20,7 +20,7 @@ failed=0 for gopackage in ${GOPACKAGES}; do echo "--- testing: ${gopackage} ---" # shellcheck disable=SC2086 - go test ${GOTESTOPTS} "${gopackage}" || ((failed += 1)) + go test -mod=vendor -v ${GOTESTOPTS} "${gopackage}" || ((failed += 1)) if [[ -f cover.out ]]; then # Append to coverfile grep -v "^mode: count" cover.out >>"${COVERFILE}"