Skip to content

Commit

Permalink
gocovmerge needs “count” mode
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotchance committed May 30, 2017
1 parent 540c35d commit 4fd4aae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4fd4aae

Please sign in to comment.