From 4fd4aae24fbd131fab3429a6cb4aadbd93ad4944 Mon Sep 17 00:00:00 2001 From: Elliot Chance Date: Wed, 31 May 2017 01:04:37 +0200 Subject: [PATCH] =?UTF-8?q?gocovmerge=20needs=20=E2=80=9Ccount=E2=80=9D=20?= =?UTF-8?q?mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 500364c9b..001a296a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,9 +57,11 @@ script: export PKGS_DELIM=$(echo "$PKGS" | paste -sd "," -) # Run tests and append all output to out.txt. It's important we have "-v" - # so that all the test names are printed. + # so that all the test names are printed. It's also important that the + # covermode be set to "count" so that the coverage profiles can be merged + # correctly together with gocovmerge. rm -f /tmp/out.txt - go list -f '{{if or (len .TestGoFiles) (len .XTestGoFiles)}}go test -v -tags=integration -race -coverprofile {{.Name}}_{{len .Imports}}_{{len .Deps}}.coverprofile -coverpkg $PKGS_DELIM {{.ImportPath}}{{end}} >> /tmp/out.txt' $PKGS | xargs -I {} bash -c {} + go list -f '{{if or (len .TestGoFiles) (len .XTestGoFiles)}}go test -v -tags=integration -race -covermode count -coverprofile {{.Name}}_{{len .Imports}}_{{len .Deps}}.coverprofile -coverpkg $PKGS_DELIM {{.ImportPath}}{{end}} >> /tmp/out.txt' $PKGS | xargs -I {} bash -c {} if [ $? -ne 0 ]; then # Print out the failures (removing a lot of the noise). cat /tmp/out.txt | grep -v -- "--- PASS" | grep -v -- "=== RUN"