From e225e63086ebfa66eca3f7580af677554b883e54 Mon Sep 17 00:00:00 2001 From: Serban Constantin Date: Fri, 12 Oct 2018 12:51:58 +0300 Subject: [PATCH] fail Travis build if tests fail Currently, due to a bug in Travis-CI, the build won't fail unless the last command in the script directive fails. This means that if the lint or tests or coverage fail, the Travis CI build itself won't fail, in turn giving the false sense that everything is OK and the PR can be merged. In order to work around this Travis CI limitation we need to explicitly ask for the shell to exit with an error immediately if a command exits with a non-zero status. (set -e) --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 420ba0f..643252d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,13 @@ branches: install: - pip install pytest coverage codacy-coverage script: + - set -e - printenv - ls -la - coverage run -m py.test tests - coverage xml - python-codacy-coverage -r coverage.xml + - set +e deploy: provider: pypi user: devopshq