diff --git a/scripts/ci/backend-tests/pkgs-with-tests-named.sh b/scripts/ci/backend-tests/pkgs-with-tests-named.sh index ea8cf286880..82a677cab24 100755 --- a/scripts/ci/backend-tests/pkgs-with-tests-named.sh +++ b/scripts/ci/backend-tests/pkgs-with-tests-named.sh @@ -44,7 +44,7 @@ done shift $((OPTIND - 1)) if [[ ${#dirs[@]} -eq 0 ]]; then - dirs+=("./...") + readarray -t dirs <<< "$(find . -type f -name 'go.mod' -exec dirname '{}' ';' | awk '{ print $1 "/..."; }')" fi if [ -z "$beginningWith" ]; then for pkg in "${dirs[@]}"; do diff --git a/scripts/ci/backend-tests/shard.sh b/scripts/ci/backend-tests/shard.sh index 6e2702c610a..cce9d944b2e 100755 --- a/scripts/ci/backend-tests/shard.sh +++ b/scripts/ci/backend-tests/shard.sh @@ -100,7 +100,7 @@ if [[ $n -gt $m ]]; then exit 1 fi if [[ ${#dirs[@]} -eq 0 ]]; then - dirs+=("./...") + readarray -t dirs <<< "$(find . -type f -name 'go.mod' -exec dirname '{}' ';' | awk '{ print $1 "/..."; }')" fi # If dirs is just ("-"), read from stdin instead. if [[ ${#dirs[@]} -eq 1 && "${dirs[0]}" == "-" ]]; then