From 2fcf1c00d77e6fbfdf488518d61c4c5192c9bf8d Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Thu, 19 Oct 2017 14:18:13 +0100 Subject: [PATCH] Fix Travis doctests error handling. --- .travis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec9e57df36..ee12709209 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ sudo: false env: matrix: - - TEST_TARGET=default - - TEST_TARGET=default TEST_MINIMAL=true - TEST_TARGET=coding + - TEST_TARGET=default TEST_MINIMAL=true + - TEST_TARGET=default - TEST_TARGET=example - TEST_TARGET=doctest @@ -116,15 +116,19 @@ script: - if [[ $TEST_TARGET == 'example' ]]; then python -m iris.tests.runner --example-tests --print-failed-images --num-processors=8; fi + + # Capture install-dir: As a test command must be last for get Travis to check + # the RC, so it's best to start each operation with an absolute cd. + - INSTALL_DIR=$(pwd) + # "make html" produces an error when run on Travis that does not # affect any downstream functionality but causes the build to fail # spuriously. The echo-backtick workaround gets around this error, # which should be investigated further in the future. - if [[ $TEST_TARGET == 'doctest' ]]; then - cd docs/iris; + cd $INSTALL_DIR/docs/iris; echo `make clean html`; make doctest; - cd ../../; fi # Split the organisation out of the slug. See https://stackoverflow.com/a/5257398/741316 for description. @@ -142,10 +146,10 @@ script: # An extra call to check "whatsnew" contributions are valid, because the # Iris test for it needs a *developer* install to be able to find the docs. - if [[ $TEST_TARGET == 'doctest' ]]; then - cd docs/iris/src/whatsnew; + cd $INSTALL_DIR/docs/iris/src/whatsnew; python aggregate_directory.py --checkonly; - cd ../../../../; fi - if [[ $TEST_TARGET == 'coding' ]]; then + cd $INSTALL_DIR; python setup.py test --coding-tests; fi