From 7d6414dcf2131fd55af2a91b9c636bb6e3aa159c Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Thu, 6 Jul 2017 09:32:06 -0600 Subject: [PATCH] Run code coverage in `script:` For all builds, we were running `go test -race`, and for a specific version of Go, we were running the code coverage suite on success. The code coverage uses `-covermode=atomic`, which is equivalent of running with `-race`, so we will now run the code coverage in the `script: ` section for that Go version and `go test -race` for the other. This prevents the double tests for the target Go version. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 65b342d3..651adcd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ before_script: - if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]]; then ./scripts/cross_compile.sh $TRAVIS_TAG; fi script: - go test -i -race $EXCLUDE_VENDOR -- go test -v -race $EXCLUDE_VENDOR +- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]]; then ./scripts/cov.sh TRAVIS; else go test -v -race $EXCLUDE_VENDOR; fi after_success: -- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]]; then ./scripts/cov.sh TRAVIS; fi - if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]] && [ "$TRAVIS_TAG" != "" ]; ghr --owner nats-io --token $GITHUB_TOKEN --draft --replace $TRAVIS_TAG pkg/; fi