Skip to content

Commit

Permalink
Merge pull request #95 from OnePunMan/bug/go-unit-test-false-positive
Browse files Browse the repository at this point in the history
Fix go-unit-test script falsely succeeding if go list ./... fails
  • Loading branch information
dnephin committed Sep 29, 2022
2 parents 74f6978 + 2f9ab51 commit fb24a63
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions run-go-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env bash
FILES=$(go list ./... | grep -v /vendor/)

go test -tags=unit -timeout 30s -short -v ${FILES}

returncode=$?
if [ $returncode -ne 0 ]; then
fail() {
echo "unit tests failed"
exit 1
fi
}

FILES=$(go list ./... | grep -v /vendor/) || fail
go test -tags=unit -timeout 30s -short -v ${FILES} || fail

0 comments on commit fb24a63

Please sign in to comment.