Skip to content

Commit

Permalink
Merge pull request #2937 from kinow/set-location-of-coverage-file
Browse files Browse the repository at this point in the history
Set location of coverage file in Travis
  • Loading branch information
oliver-sanders authored Feb 1, 2019
2 parents 9ca798d + a314f13 commit 71480d8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 71480d8

Please sign in to comment.