From 988899abdb341b357f1845541528d59f5df7cf2b Mon Sep 17 00:00:00 2001 From: Elliot Chance Date: Sat, 3 Jun 2017 17:12:38 +1000 Subject: [PATCH] Better handling of failures on travis --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1d5d11dc..cac51f7f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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` @@ -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"