Skip to content

Commit

Permalink
Use absolute locations for sources
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Feb 1, 2019
1 parent 0534de0 commit 8f0e114
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ env:
install: .travis/install.sh functional-tests docs
script:
- export PYTHONPATH="${TRAVIS_BUILD_DIR}/.travis"
# As we fork processes, we need to make sure to point where each forked process
# will put its .coverage... files. Otherwise they may be created under directories
# that `coverage combine` isn't expecting, causing the report to omit tests.
# On the other hand, changing .coveragerc directly affects developers running
# coverage locally. Therefore, we have this sed line here only for Travis.
- sed -i -e "s|data_file=.coverage|data_file=${TRAVIS_BUILD_DIR}/.coverage|g" .coveragerc
- coverage run .travis/cover.py
# 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 --rcfile /tmp/.coveragerc .travis/cover.py
- unset PYTHONPATH
after_script: .travis/after_script.sh
after_success:
Expand Down

0 comments on commit 8f0e114

Please sign in to comment.