fix(scripts): remove bash 4.0 dependency in coverage script
`readarray` is a bash builtin introduced in 4.0. This change removes
its use so `make go-test-coverage` can be run on Macs which only ship
with bash 3.2 preinstalled.
Fixes
set -aueo pipefail
-readarray -t modules < <(go list ./... | \
+modules=$(go list ./... | \
grep -v tests/framework | \
grep -v tests/e2e | \
grep -v tests/scenarios | \
@@ -12,12 +12,13 @@ readarray -t modules < <(go list ./... | \
grep -v experimental/ | \
grep -v scripts/)
+# shellcheck disable=SC2086
go test -timeout 120s \
-failfast \
-race \
-v \
-coverprofile=coverage.txt.with_generated_code \
- -covermode atomic "${modules[@]}" | tee testoutput.txt || { echo "go test returned non-zero"; exit 1; }
+ -covermode atomic $modules | tee testoutput.txt || { echo "go test returned non-zero"; exit 1; }
# shellcheck disable=SC2002
cat coverage.txt.with_generated_code | grep -v "_generated.go" | grep -v "fake.go" | grep -v "pkg/gen" | grep -v "pkg/apis" > coverage.txt
