Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit fb24a63

Browse files
authored
Merge pull request #95 from OnePunMan/bug/go-unit-test-false-positive
Fix go-unit-test script falsely succeeding if go list ./... fails
2 parents 74f6978 + 2f9ab51 commit fb24a63

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

run-go-unit-tests.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env bash
2-
FILES=$(go list ./... | grep -v /vendor/)
32

4-
go test -tags=unit -timeout 30s -short -v ${FILES}
5-
6-
returncode=$?
7-
if [ $returncode -ne 0 ]; then
3+
fail() {
84
echo "unit tests failed"
95
exit 1
10-
fi
6+
}
7+
8+
FILES=$(go list ./... | grep -v /vendor/) || fail
9+
go test -tags=unit -timeout 30s -short -v ${FILES} || fail

0 commit comments

Comments
 (0)