Last active
November 16, 2017 23:54
-
-
Save kevina/0b81bb07379138c37b65f785a88b13c0 to your computer and use it in GitHub Desktop.
Standard script to run tests for ipfs projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
display_and_run() { | |
echo "*** $@" | |
"$@" | |
} | |
# Vet | |
display_and_run go vet ./... | |
# Test | |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | |
go list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' ./... \ | |
| grep -v /vendor/ \ | |
| while read pkg; do | |
profile="coverage.$(echo "$pkg" | md5sum | head -c 16).txt" | |
display_and_run go test -v $TEST_FLAGS -coverprofile="$profile" -covermode=atomic "$pkg" | |
done | |
# Doesn't count as a failure. | |
echo "*** Processing coverage report" | |
bash <(curl -s https://codecov.io/bash) || true | |
else | |
display_and_run go test -v $TEST_FLAGS ./... | |
fi |
Okay I used GOTFLAGS.
The new home is now https://gist.github.com/kevina/0b81bb07379138c37b65f785a88b13c0#gistcomment-2260476
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TEST_FLAGS
is namedGOTFLAGS
in go-ipfs, if you don't see much of an issue I would prefer this name.