From 6ef55145f55fb6c6b726282a18abacc08fb7af99 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 27 Aug 2017 13:39:58 -0700 Subject: [PATCH] travis: Merge the static-analysis build into backend. [Tweaked by gnprice to leave the use of --linecoverage-report unmodified for now.] --- .travis.yml | 2 -- docs/mypy.md | 2 +- tools/test-all | 4 +--- tools/travis/backend | 5 +++++ tools/travis/setup-static-analysis | 11 ----------- tools/travis/static-analysis | 23 ----------------------- 6 files changed, 7 insertions(+), 40 deletions(-) delete mode 100755 tools/travis/setup-static-analysis delete mode 100755 tools/travis/static-analysis diff --git a/.travis.yml b/.travis.yml index db5381e868..f57704fc81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,8 +45,6 @@ matrix: # that doesn't seem to be documented, but it's what we see empirically. # We only get 4 jobs running at a time, so we try to make the first few # the most likely to break. - - python: "3.4" - env: TEST_SUITE=static-analysis - python: "3.4" env: TEST_SUITE=frontend - python: "3.4" diff --git a/docs/mypy.md b/docs/mypy.md index ee651f59fd..92ea2c16d4 100644 --- a/docs/mypy.md +++ b/docs/mypy.md @@ -28,7 +28,7 @@ You can learn more about it at: * [Using mypy with Python 2 code](http://mypy.readthedocs.io/en/latest/python2.html) The mypy type checker is run automatically as part of Zulip's Travis -CI testing process in the 'static-analysis' build. +CI testing process in the `backend` build. ## `type_debug.py` diff --git a/tools/test-all b/tools/test-all index 2195a65652..9c9504f489 100755 --- a/tools/test-all +++ b/tools/test-all @@ -34,9 +34,6 @@ function run { run ./tools/check-provision $FORCEARG run ./tools/clean-repo -# travis/static-analysis -run ./tools/run-mypy - # travis/backend run ./tools/lint $FORCEARG run ./manage.py makemessages --locale en @@ -44,6 +41,7 @@ run env PYTHONWARNINGS=ignore ./tools/check-capitalization --no-generate run env PYTHONWARNINGS=ignore ./tools/check-frontend-i18n --no-generate run ./tools/test-tools run ./tools/test-backend $FORCEARG +run ./tools/run-mypy run ./tools/test-migrations # Not running SVG optimizing since it's low-churn # run ./tools/optimize-svg diff --git a/tools/travis/backend b/tools/travis/backend index 371f7d1429..b82c538fdb 100755 --- a/tools/travis/backend +++ b/tools/travis/backend @@ -12,6 +12,11 @@ PYTHONWARNINGS=ignore ./tools/check-frontend-i18n --no-generate ./tools/test-tools ./tools/test-backend --coverage + +# We run mypy after the backend tests so we get output from the +# backend tests, which tend to uncover more serious problems, first. +./tools/run-mypy --linecoverage-report + ./tools/test-migrations ./tools/optimize-svg ./tools/test-documentation diff --git a/tools/travis/setup-static-analysis b/tools/travis/setup-static-analysis deleted file mode 100755 index 3903dee782..0000000000 --- a/tools/travis/setup-static-analysis +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e -set -x - -# We only need the mypy checker in this build, so we just install that -# directly, skipping provision. - -if ! pip install --no-deps -r requirements/mypy.txt; then - echo "\`pip install --no-deps -r requirements/mypy.txt\`: Failure occured while trying to perform dependancy installation, Retrying..." - pip install --no-deps -r requirements/mypy.txt -fi diff --git a/tools/travis/static-analysis b/tools/travis/static-analysis deleted file mode 100755 index f5eb579b08..0000000000 --- a/tools/travis/static-analysis +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -e -set -x - -retcode=0 -./tools/run-mypy --linecoverage-report || retcode=1 -set +x -if [ "$retcode" == "0" ]; then - echo "The mypy static type checker for python detected no errors!" -else - echo - echo "The mypy static type checker for Python threw some errors," - echo "which indicates a bug in your code or incorrect type annotations." - echo "Please see http://zulip.readthedocs.io/en/latest/mypy.html for details" - echo "on mypy, how Zulip is using mypy, and how to debug common issues." - exit "$retcode" -fi -set -x - -# NB: Everything here should be in `tools/test-all`. If there's a -# reason not to run it there, it should be there as a comment -# explaining why.