Skip to content

Commit

Permalink
Fix test coverage setup
Browse files Browse the repository at this point in the history
We do not add Cython line tracing and test coverage, because it
absolutely tanks performance to the level that the coverage job on
Travis will take well over two hours to complete (instead of 15-20
minutes).
  • Loading branch information
jakelishman committed Aug 25, 2020
1 parent 8e181cc commit 1c998a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[run]
include = */qutip/*
omit = */tests/*
source = qutip
omit =
# QuTiP test files
*/qutip/tests/*

[report]
exclude_lines =
# Skip Python wrappers which help load in C extension modules.
__bootstrap__()
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ _stage_generic_linux: &stage_generic_linux
language: python
# change dir
before_script:
- QUTIP_DOWNLOAD=$(pwd -P)
- mkdir qutip_testing
- cd qutip_testing
# command to run tests
script:
- python -m qutip.about
- pytest --verbosity=1 --disable-pytest-warnings --cov=qutip --pyargs qutip
- QUTIP_INSTALL=$(dirname $(python -c 'import qutip; print(qutip.__file__)'))
- pytest --verbosity=1 --cov=qutip --cov-config="${QUTIP_DOWNLOAD}/.coveragerc" --rootdir="${QUTIP_INSTALL}/qutip/tests" -c "${QUTIP_INSTALL}/qutip/tests/pytest.ini" --pyargs qutip
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
Expand Down Expand Up @@ -111,7 +113,7 @@ _stage_linux_omp: &stage_linux_omp
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
- source activate test-environment
- conda install mkl blas=*=mkl numpy 'scipy<1.5' pytest pytest-cov cython coveralls
- python setup.py install --with-openmp
- python setup.py install --with-openmp --line-trace
after_success:
- coveralls

Expand All @@ -122,12 +124,14 @@ _stage_osx_37: &stage_osx_37
language: generic
# change dir
before_script:
- QUTIP_DOWNLOAD=$(pwd -P)
- mkdir qutip_testing
- cd qutip_testing
# command to run tests
script:
- python -m qutip.about
- pytest --verbosity=1 --disable-pytest-warnings --cov=qutip --pyargs qutip
- QUTIP_INSTALL=$(dirname $(python -c 'import qutip; print(qutip.__file__)'))
- pytest --verbosity=1 --cov=qutip --cov-config="${QUTIP_DOWNLOAD}/.coveragerc" --rootdir="${QUTIP_INSTALL}/qutip/tests" -c "${QUTIP_INSTALL}/qutip/tests/pytest.ini" --pyargs qutip
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
Expand All @@ -148,12 +152,14 @@ _stage_osx_38: &stage_osx_38
language: generic
# change dir
before_script:
- QUTIP_DOWNLOAD=$(pwd -P)
- mkdir qutip_testing
- cd qutip_testing
# command to run tests
script:
- python -m qutip.about
- pytest --verbosity=1 --disable-pytest-warnings --cov=qutip --pyargs qutip -m "not slow"
- QUTIP_INSTALL=$(dirname $(python -c 'import qutip; print(qutip.__file__)'))
- pytest --verbosity=1 --cov=qutip --cov-config="${QUTIP_DOWNLOAD}/.coveragerc" --rootdir="${QUTIP_INSTALL}/qutip/tests" -c "${QUTIP_INSTALL}/qutip/tests/pytest.ini" --pyargs qutip
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
Expand Down

0 comments on commit 1c998a8

Please sign in to comment.