Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage calculation accounting for concurrency #566

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
[run]
branch = True
concurrency = multiprocessing
concurrency =
multiprocessing
threading
subprocess
source =
peas
pocs
omit =
omit =
pocs/utils/data.py
parallel = True

[report]
exclude_lines =
Expand Down
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python:
cache:
- pip
env:
- POCS=$TRAVIS_BUILD_DIR PANDIR=/var/panoptes ARDUINO_VERSION=1.8.1
- POCS=$TRAVIS_BUILD_DIR PANDIR=/var/panoptes PANUSER=$USER ARDUINO_VERSION=1.8.1
before_install:
- sudo mkdir /var/panoptes && sudo chmod 777 /var/panoptes
- mkdir $PANDIR/logs
Expand Down Expand Up @@ -37,17 +37,17 @@ addons:
apt:
packages:
- gphoto2
- libcairo2-dev
- libnetpbm10-dev
- libcairo2-dev
- libnetpbm10-dev
- netpbm
- libpng12-dev
- libjpeg-dev
- python-numpy
- python-pyfits
- python-dev
- zlib1g-dev
- libbz2-dev
- swig
- python-dev
- zlib1g-dev
- libbz2-dev
- swig
- cfitsio-dev
install:
- wget http://astrometry.net/downloads/astrometry.net-0.72.tar.gz
Expand All @@ -74,8 +74,10 @@ script:
- arduino --verify --board $BOARD resources/arduino_files/camera_board/camera_board.ino
- arduino --verify --board $BOARD resources/arduino_files/power_board/power_board.ino
- arduino --verify --board $BOARD resources/arduino_files/telemetry_board/telemetry_board.ino
- export PYTHONPATH="$PYTHONPATH:$TRAVIS_BUILD_DIR/scripts/coverage"
- export COVERAGE_PROCESS_START=.coveragerc
- coverage run $(which pytest) -v
- coverage combine .coverage*
- coverage combine

after_success:
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then
Expand Down
5 changes: 5 additions & 0 deletions scripts/coverage/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ensure coverage starts for all Python processes so that test coverage is calculated
# properly when using subprocesses (see https://coverage.readthedocs.io/en/latest/subprocess.html)
import coverage
print("Starting coverage")
coverage.process_startup()