Skip to content

Commit

Permalink
Merge pull request #1139 from stripe/brandur-test-conditionally
Browse files Browse the repository at this point in the history
Test only on Go 1.13+
  • Loading branch information
brandur-stripe authored Jul 21, 2020
2 parents b73c31e + 01e9e12 commit 4b5a905
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@ before_install:
# Install various build dependencies. We use `travis_retry` because `go get`
# will occasionally fail intermittently.

# The testify require framework is used for assertions in the test suite
- travis_retry go get -u github.com/stretchr/testify/require
# Testify is used for assertions in the test suite.
#
# Unfortunately, they broke versions of Go < 1.13. so we conditionally fetch
# and test only on newer versions of Go. We can back this conditional out
# once we've dropped < 1.13.
#
# Comparing versions lexically like this is technically not safe, but I'm
# cheating a bit by taking advantage of the fact that we only support > 1.9,
# so comparing Go versions lexically will be safe for quite some time -- well
# beyond the point where we back this out. `tip` also sorts after any version.
- |
if [[ "$TRAVIS_GO_VERSION" > "1.13" ]]; then
travis_retry go get -u github.com/stretchr/testify/require
fi
# Install lint / code coverage / coveralls tooling
- travis_retry go get -u golang.org/x/net/http2
Expand Down Expand Up @@ -50,8 +62,17 @@ matrix:
fast_finish: true

script:
- make
- make coverage
- |
# See note above, but Testify broke versions < 1.13, so we only build (and
# not test) on older versions. Drop this after we've dropped support for <
# 1.13.
if [[ "$TRAVIS_GO_VERSION" > "1.13" ]]; then
make
make coverage
else
make build
fi
after_script:
# Send code coverage report to coveralls.io
Expand Down

0 comments on commit 4b5a905

Please sign in to comment.