diff --git a/.travis.yml b/.travis.yml index 97f55e7638d..67ff2fcd1ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,8 @@ env: - CYLC_TEST_RUN_PLATFORM=false # Custom diff command to ignore Xlib errors (xvfb has not RANDR extension). - CYLC_TEST_DIFF_CMD="diff -I Xlib -u" - - COVERAGE_PROCESS_START="${TRAVIS_BUILD_DIR}/.coveragerc" + # This coverage RC file is created under the script task + - COVERAGE_PROCESS_START="/tmp/.coveragerc" matrix: - CHUNK="1/4" - CHUNK="2/4" @@ -58,6 +59,14 @@ env: install: .travis/install.sh functional-tests docs script: - export PYTHONPATH="${TRAVIS_BUILD_DIR}/.travis" +# When we run cylc commands, there are processes being forked, that get a +# new working directory. As .coveragerc contains relatives paths, it fails +# to produce the correct coverage, unless we use absolute paths. The `sed` +# call below tries to define the data_file, and sources locations for Travis. +- sed -e "s|data_file=.coverage|data_file=${TRAVIS_BUILD_DIR}/.coverage|g; s|./bin|${TRAVIS_BUILD_DIR}/bin|g; s|./lib|${TRAVIS_BUILD_DIR}/lib|g" .coveragerc > /tmp/.coveragerc +# And some tests fail if we touch files in the git working directory, due +# to Cylc's version appearing with the "dirty" suffix. To avoid this, we +# are using a new coveragerc created under the temporary directory. - coverage run .travis/cover.py - unset PYTHONPATH after_script: .travis/after_script.sh