From 6d652cca4d6f55a28f073fe05e6b866039537d6b Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 8 Jun 2016 15:14:36 +0700 Subject: [PATCH] run unit and integration tests separately, only generate coverage reports for unit tests --- .travis.yml | 13 ++++++------- .travis/after_success.sh | 9 +++++++++ .travis/script.sh | 12 ++++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100755 .travis/after_success.sh create mode 100755 .travis/script.sh diff --git a/.travis.yml b/.travis.yml index 170eabb4..8a4f4c69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,10 @@ go: # setting the GOARCH directly doesn't work, since the value will be overwritten later # so set it to a temporary environment variable first env: - - TRAVIS_GOARCH=amd64 - - TRAVIS_GOARCH=386 + - TRAVIS_GOARCH=amd64 TESTMODE=unit + - TRAVIS_GOARCH=amd64 TESTMODE=integration + - TRAVIS_GOARCH=386 TESTMODE=unit + - TRAVIS_GOARCH=386 TESTMODE=integration # second part of the GOARCH workaround # now actually set the GOARCH env variable to the value of the temporary variable set earlier @@ -26,10 +28,7 @@ before_install: - go env # for debugging script: - - go get -t ./... - - ginkgo -r --cover --randomizeAllSpecs --randomizeSuites --trace --progress + - .travis/script.sh after_success: - - cat quic-go.coverprofile > coverage.txt - - cat */*.coverprofile >> coverage.txt - - bash <(curl -s https://codecov.io/bash) -f coverage.txt + - .travis/after_success.sh diff --git a/.travis/after_success.sh b/.travis/after_success.sh new file mode 100755 index 00000000..4c914a9f --- /dev/null +++ b/.travis/after_success.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +if [ ${TESTMODE} == "unit" ]; then + cat quic-go.coverprofile > coverage.txt + cat */*.coverprofile >> coverage.txt + bash <(curl -s https://codecov.io/bash) -f coverage.txt +fi diff --git a/.travis/script.sh b/.travis/script.sh new file mode 100755 index 00000000..adf3268e --- /dev/null +++ b/.travis/script.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +go get -t ./... +if [ ${TESTMODE} == "unit" ]; then + ginkgo -r --cover --randomizeAllSpecs --randomizeSuites --trace --progress --skipPackage integrationtests +fi + +if [ ${TESTMODE} == "integration" ]; then + ginkgo -r --randomizeAllSpecs --randomizeSuites --trace --progress integrationtests +fi