run unit and integration tests separately, only generate coverage reports for unit tests

This commit is contained in:
Marten Seemann
2016-06-08 15:14:36 +07:00
parent c15fb86425
commit 6d652cca4d
3 changed files with 27 additions and 7 deletions

View File

@@ -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

9
.travis/after_success.sh Executable file
View File

@@ -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

12
.travis/script.sh Executable file
View File

@@ -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