diff options
author | Dmitrii Okunev <xaionaro@fb.com> | 2019-11-28 12:10:49 +0000 |
---|---|---|
committer | Dmitrii Okunev <xaionaro@fb.com> | 2019-11-28 12:10:49 +0000 |
commit | 92b156c5580501ec2a4e8a504edbc3db55d7df82 (patch) | |
tree | 3161f6119c58160b89a324804c39ede08784c51c /.travis | |
parent | ec0e0154d15c429b3dcc56af60a2d7b62eb3d5e7 (diff) |
Simplified porting from client4 to nclient4
Signed-off-by: Dmitrii Okunev <xaionaro@fb.com>
Diffstat (limited to '.travis')
-rwxr-xr-x | .travis/tests.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/.travis/tests.sh b/.travis/tests.sh index b48a3c2..edf17ba 100755 --- a/.travis/tests.sh +++ b/.travis/tests.sh @@ -10,14 +10,23 @@ echo "" > coverage.txt # tests. ip a +GO_TEST_OPTS=() +if [[ "$TRAVIS_GO_VERSION" =~ ^1.(9|10|11|12)$ ]] +then + # We use fmt.Errorf with verb "%w" which appeared only in Go1.13. + # So the code compiles and works with Go1.12, but error descriptions + # looks uglier and it does not pass "vet" tests on Go<1.13. + GO_TEST_OPTS+='-vet=off' +fi + for d in $(go list ./... | grep -v vendor); do - go test -race -coverprofile=profile.out -covermode=atomic $d + go test -race -coverprofile=profile.out -covermode=atomic ${GO_TEST_OPTS[@]} $d if [ -f profile.out ]; then cat profile.out >> coverage.txt rm profile.out fi # integration tests - go test -c -cover -tags=integration -race -covermode=atomic $d + go test -c -cover -tags=integration -race -covermode=atomic ${GO_TEST_OPTS[@]} $d testbin="./$(basename $d).test" # only run it if it was built - i.e. if there are integ tests test -x "${testbin}" && sudo "./${testbin}" -test.coverprofile=profile.out |