Skip to content

Commit

Permalink
Better handling of failures on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotchance committed Jun 3, 2017
1 parent a9d27e0 commit 988899a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@ script:
# 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.
#
# Exit code 123 will be returned if any of the tests fail.
rm -f /tmp/out.txt
go list -f 'go test -v -tags=integration -race -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg $PKGS_DELIM {{.ImportPath}}' $PKGS |
xargs -I{} bash -c '{} >> /tmp/out.txt'
if [ $? -ne 0 ]; then
# Print out the failures (removing a lot of the noise).
cat /tmp/out.txt | grep -v -- "--- PASS" | grep -v -- "=== RUN"
exit 1
fi
xargs -I{} bash -c '{}'
# Merge coverage profiles.
COVERAGE_FILES=`ls -1 *.coverprofile 2>/dev/null | wc -l`
Expand Down Expand Up @@ -95,3 +92,7 @@ script:

after_success:
- include_cov=coverage.txt bash <(curl -s https://codecov.io/bash)

after_failure:
# Print out the failures (removing a lot of the noise).
- cat /tmp/out.txt | grep -v -- "--- PASS" | grep -v -- "=== RUN"

0 comments on commit 988899a

Please sign in to comment.