Skip to content

Commit cc071b2

Browse files
committed
hack: properly test ./...
GHA still ran all of the tests, but hack/test.sh did not properly run the tests recursively due to the behaviour of go's arg parsing. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent a1c1895 commit cc071b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hack/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ done
3838
gocoverdir="$(mktemp --tmpdir -d gocoverdir.XXXXXXXX)"
3939
trap 'rm -rf $gocoverdir' EXIT
4040

41-
test_args=()
41+
test_args=("-count=1" "-cover" "-coverpkg=./...")
4242
[ -n "$verbose" ] && test_args+=("-v")
4343
[ -z "$long" ] && test_args+=("-short")
4444

45-
"$GO" test -count 1 -cover -test.gocoverdir="$gocoverdir" "${test_args[@]}" ./...
46-
sudo "$GO" test -count 1 -cover -test.gocoverdir="$gocoverdir" "${test_args[@]}" ./...
45+
"$GO" test "${test_args[@]}" ./... -args -test.gocoverdir="$gocoverdir"
46+
sudo "$GO" test "${test_args[@]}" ./... -args -test.gocoverdir="$gocoverdir"
4747

4848
"$GO" tool covdata percent -i "$gocoverdir"
4949
[ -n "$silent" ] || "$GO" tool covdata func -i "$gocoverdir" | sort -k 3gr

0 commit comments

Comments
 (0)