Skip to content

Commit 6788df7

Browse files
committed
TravisCI: Only run tests once.
This modifies the goclean.sh script that is executed on Travis to only run the tests once. While it is nice to see coverage reports in the log, unfortunately it appears that both the -race and -cover flags can't be used together, and the tests have grown in complexity such that they are starting to get close to TravisCI time limits.
1 parent efa50e6 commit 6788df7

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

goclean.sh

-24
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# 4. gosimple (https://github.com/dominikh/go-simple)
77
# 5. unconvert (https://github.com/mdempsky/unconvert)
88
# 6. race detector (http://blog.golang.org/race-detector)
9-
# 7. test coverage (http://blog.golang.org/cover)
109
#
1110
# gometalinter (github.com/alecthomas/gometalinter) is used to run each static
1211
# checker.
@@ -38,26 +37,3 @@ test -z "$(gometalinter -j 4 --disable-all \
3837
--enable=unconvert \
3938
--deadline=10m $linter_targets 2>&1 | grep -v 'ALL_CAPS\|OP_' 2>&1 | tee /dev/stderr)"
4039
env GORACE="halt_on_error=1" go test -race -tags rpctest $linter_targets
41-
42-
# Run test coverage on each subdirectories and merge the coverage profile.
43-
44-
set +x
45-
echo "mode: count" > profile.cov
46-
47-
# Standard go tooling behavior is to ignore dirs with leading underscores.
48-
for dir in $(find . -maxdepth 10 -not -path '.' -not -path './.git*' \
49-
-not -path './.glide*' -not -path '*/_*' -not -path './cmd*' \
50-
-not -path './release*' -not -path './vendor*' -type d)
51-
do
52-
if ls $dir/*.go &> /dev/null; then
53-
go test -covermode=count -coverprofile=$dir/profile.tmp $dir
54-
if [ -f $dir/profile.tmp ]; then
55-
cat $dir/profile.tmp | tail -n +2 >> profile.cov
56-
rm $dir/profile.tmp
57-
fi
58-
fi
59-
done
60-
61-
# To submit the test coverage result to coveralls.io,
62-
# use goveralls (https://github.com/mattn/goveralls)
63-
# goveralls -coverprofile=profile.cov -service=travis-ci

0 commit comments

Comments
 (0)