travis: Force coverage files to be written in the working dir

This commit is contained in:
Christian Decker
2020-05-23 18:01:00 +02:00
parent cfc6a8b33e
commit fd0e492e2f
2 changed files with 3 additions and 9 deletions

View File

@@ -1,3 +1,2 @@
#!/bin/bash
export COVERAGE_FILE=/tmp/.coverage
coverage run --omit='/home/travis/.local/,*/.direnv/*' --parallel-mode "$@"

View File

@@ -74,6 +74,9 @@ export PATH="/tmp/lightning/lightningd/:$PATH"
# up again.
export PATH="$CWD/.travis/bin:$PATH"
# Force coverage to write files in $CWD
export COVERAGE_FILE="$CWD/.coverage"
# Make sure we use the correct python3 wrapper (the one that calls coverage
# internally).
which python3
@@ -81,11 +84,3 @@ which python3
rm /tmp/.coverage.* .coverage.tmp .coverage || true
pytest -vvv --timeout=550 --timeout_method=thread -p no:logging -n 2
# Print the coverage files
ls -lha /tmp/.coverage.*
# Now collect the results in a single file so coveralls finds them
touch .coverage
mv .coverage .coverage.tmp
coverage combine -a /tmp/.coverage.* .coverage.tmp