Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Try out codecov.io
  • Loading branch information
pitrou committed Mar 9, 2016
1 parent b0e4b81 commit 354efa8
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 49 deletions.
10 changes: 7 additions & 3 deletions coverage.conf → .coveragerc
Expand Up @@ -2,14 +2,18 @@
[run]
branch = True
source = numba
concurrency = multiprocessing
parallel = True

[report]

omit =
*/__main__.py
numba/six.py
numba/_version.py

exclude_lines =
pragma: no cover
if __name__ == .__main__.:

omit =
*/__main__.py

[html]
92 changes: 51 additions & 41 deletions .travis.yml
Expand Up @@ -4,62 +4,72 @@
dist: trusty

matrix:
include:
- env: PYTHON=2.7 NUMPY="numpy=1.7"
- env: PYTHON=3.4 NUMPY="numpy=1.9"
- env: PYTHON=3.5 NUMPY="numpy=1.10"
include:
- env: PYTHON=2.7 NUMPY="numpy=1.7"
- env: PYTHON=3.4 NUMPY="numpy=1.9" BUILD_DOC=yes
- env: PYTHON=3.5 NUMPY="numpy=1.10" RUN_COVERAGE=yes

branches:
only:
- master
only:
- master

before_install:
# Install Miniconda
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=$HOME/miniconda3/bin:$PATH
# Setup environment
- conda update --yes conda
# Scipy and CFFI are optional dependencies, but exercised in the test suite
- conda create -n travisci --yes python=$PYTHON $NUMPY cffi pip scipy
- source activate travisci
- CONDA_INSTALL="conda install --yes -q"
- PIP_INSTALL="pip install -q"
# Install llvmdev (separate channel, for now)
- $CONDA_INSTALL -c numba llvmdev="3.7*"
# Install enum34 and singledispatch for Python < 3.4
- if [ $PYTHON \< "3.4" ]; then $CONDA_INSTALL enum34; fi
- if [ $PYTHON \< "3.4" ]; then $PIP_INSTALL singledispatch; fi
# Install funcsigs for Python < 3.3
- if [ $PYTHON \< "3.3" ]; then $CONDA_INSTALL -c numba funcsigs; fi
# Install dependencies for building the documentation
- $CONDA_INSTALL sphinx pygments
- $PIP_INSTALL sphinxjp.themecore sphinxjp.themes.basicstrap
# Install Miniconda
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=$HOME/miniconda3/bin:$PATH
# Setup environment
- conda update --yes conda
# Scipy and CFFI are optional dependencies, but exercised in the test suite
- conda create -n travisci --yes python=$PYTHON $NUMPY cffi pip scipy
- source activate travisci
- CONDA_INSTALL="conda install --yes -q"
- PIP_INSTALL="pip install -q"
# Install llvmdev (separate channel, for now)
- $CONDA_INSTALL -c numba llvmdev="3.7*"
# Install enum34 and singledispatch for Python < 3.4
- if [ $PYTHON \< "3.4" ]; then $CONDA_INSTALL enum34; fi
- if [ $PYTHON \< "3.4" ]; then $PIP_INSTALL singledispatch; fi
# Install funcsigs for Python < 3.3
- if [ $PYTHON \< "3.3" ]; then $CONDA_INSTALL -c numba funcsigs; fi
# Install dependencies for building the documentation
- if [ "$BUILD_DOC" == "yes" ]; then $CONDA_INSTALL sphinx pygments; fi
- if [ "$BUILD_DOC" == "yes" ]; then $PIP_INSTALL sphinxjp.themecore sphinxjp.themes.basicstrap; fi
# Install dependencies for code coverage (codecov.io)
- if [ "$RUN_COVERAGE" == "yes" ]; then $PIP_INSTALL codecov; fi

install:
# Build and install llvmlite from source
- git clone git://github.com/numba/llvmlite.git -q
- cd llvmlite && python setup.py build && python setup.py install -q >/dev/null && cd ..
# Build numba extensions without silencing compile errors
- python setup.py build_ext -q
- python setup.py build_ext -q --inplace
# Install numba
- python setup.py install -q >/dev/null

script:
# Ensure that the documentation builds without warnings
- cd $TRAVIS_BUILD_DIR/docs ; make SPHINXOPTS=-W clean html
- cd $TRAVIS_BUILD_DIR/docs
- if [ "$BUILD_DOC" == "yes" ]; then make SPHINXOPTS=-W clean html; fi
- cd ~
# Run the Numba test suite
- cd ~ ; NUMBA_ENABLE_CUDASIM=1 python -m numba.runtests -b -m numba.tests
# Note that coverage is run from the checkout dir to match the "source"
# directive in .coveragerc
- if [ "$RUN_COVERAGE" == "yes" ]; then cd $TRAVIS_BUILD_DIR; coverage erase; coverage run runtests.py -b -m numba.tests; fi
- if [ "$RUN_COVERAGE" != "yes" ]; then NUMBA_ENABLE_CUDASIM=1 python -m numba.runtests -b -m numba.tests; fi

after_success:
- if [ "$RUN_COVERAGE" == "yes" ]; then coverage combine; codecov; fi

notifications:
email: false
flowdock: "cb7bc57e58b3d42f77685f93211c03ab"
on_success: "change"
on_failure: "always" # "change"
webhooks:
urls:
- https://webhooks.gitter.im/e/bd67cc227432d99bf1f1
on_success: change
on_failure: always
on_start: false
email: false
flowdock: "cb7bc57e58b3d42f77685f93211c03ab"
on_success: "change"
on_failure: "always" # "change"
webhooks:
urls:
- https://webhooks.gitter.im/e/bd67cc227432d99bf1f1
on_success: change
on_failure: always
on_start: false
9 changes: 7 additions & 2 deletions numba/testing/main.py
Expand Up @@ -542,9 +542,14 @@ def _run_inner(self, result):

try:
self._run_parallel_tests(result, pool, child_runner)
finally:
# Kill the still active workers
except:
# On exception, kill still active workers immediately
pool.terminate()
else:
# On success, close the pool cleanly
pool.close()
finally:
# Always join the pool (this is necessary for coverage.py)
pool.join()
if not result.shouldStop:
stests = SerialSuite(self._stests)
Expand Down
6 changes: 3 additions & 3 deletions run_coverage.py
Expand Up @@ -20,18 +20,18 @@
# otherwise some lines will be missed.
config_file = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
'coverage.conf')
'.coveragerc')
os.environ['COVERAGE_PROCESS_START'] = config_file
cov = coverage.coverage(config_file=config_file)
cov.start()

from numba import testing
from numba import runtests

html_dir = 'htmlcov'
try:
# NOTE: we force single-process mode, since some hacks are needed
# for multiprocess'ed coverage to work.
testing.test()
runtests.main(*sys.argv[1:])
except SystemExit:
pass
finally:
Expand Down

0 comments on commit 354efa8

Please sign in to comment.