From ac04306dcfe3e12723dcf69807460a322009f59c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 29 Nov 2018 21:27:49 -0800 Subject: [PATCH] travis: collapse commands into single instance to ensure exit on fail Before this commit, if for example the linter failed, then we would go on to all the other tests rather than halting. We fix this by instead chaining the relevant commands, and eliminating the LINT env variable in the build matrix. --- .travis.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b4b61c6c..5f4380568 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,9 @@ env: global: - GOCACHE=$HOME/.go-build matrix: - - RACE=true LINT=true + - RACE=true - ITEST=true - - COVER=true + - COVER=true sudo: required install: @@ -32,19 +32,14 @@ script: # Common for all builds. - make btcd - # Run linter if LINT=true. - - 'if [ "$LINT" = true ]; then make lint ; fi' - # Run unit tests with race condition detector. - 'if [ "$RACE" = true ]; then make unit-race ; fi' # Run integration tests. - - 'if [ "$ITEST" = true ]; then make build ; fi' - - 'if [ "$ITEST" = true ]; then make itest-only ; fi' + - 'if [ "$ITEST" = true ]; then make build && make itest-only; fi' # Run unit tests and generate coverage report. - - 'if [ "$COVER" = true ]; then make unit-cover; fi' - - 'if [ "$COVER" = true ]; then make goveralls; fi' + - 'if [ "$COVER" = true ]; then make lint && make unit-cover && make goveralls; fi' after_script: - echo "Uploading to termbin.com..." && find *.log | xargs -I{} sh -c "cat {} | nc termbin.com 9999 | xargs -r0 printf '{} uploaded to %s'"