diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 65f02a08f8..9f89de4068 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -31,7 +31,8 @@ covermode=${COVERMODE:-atomic} coverdir=$(mktemp -d /tmp/coverage.XXXXXXXXXX) profile="${coverdir}/profile.out" if [ -z "$pkgs" ]; then - pkgs="$(go list -mod vendor ./... | grep -vE 'host-image|hostimage')" + pkgs="$(go list -mod vendor -test ./... | grep '\.test$' | sed -e 's/\.test$//')" + pkgs="$(echo "$pkgs" | grep -vE 'host-image|hostimage')" fi if type circleci &>/dev/null; then pkgs="$(echo "$pkgs" | circleci tests split)"