Skip to content

Commit

Permalink
switch to codecov for automatic combining of coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jab committed Nov 20, 2017
1 parent 64ed727 commit 92b3e9c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Expand Up @@ -8,4 +8,4 @@ omit=
precision = 1
exclude_lines =
pragma: no cover
abc.abstractmethod
return NotImplemented
39 changes: 23 additions & 16 deletions .travis.yml
Expand Up @@ -12,44 +12,39 @@ matrix:
include:
# Each job performs a single task, and sets a "TASK" var so it's evident in the build matrix.

# One-off jobs. Override "script" to do something other than run the default (pytest).
# One-off jobs. Override "script" and "install" to do something other than run the default (pytest).
- env: TASK=build-docs
before_script: travis_retry pip install -U Sphinx
install: travis_retry pip install Sphinx
script: travis_retry ./build-docs.sh linkcheck
- env: TASK=pylint
before_script: travis_retry pip install -U pylint
install: travis_retry pip install .[test] && travis_retry pip install pylint
script: pylint bidict tests setup.py
- env: TASK=flake8
before_script: travis_retry pip install -U flake8
install: travis_retry pip install flake8
script: flake8 bidict tests/*.py
- env: TASK=pydocstyle
before_script: travis_retry pip install -U pydocstyle
install: travis_retry pip install pydocstyle
script: pydocstyle bidict
- env: TASK=test-with-optimization-flag # make sure there are no relied-on side effects in assert statements
install: echo "(no extra install needed for doctest)"
script: python3 -O -m doctest -o IGNORE_EXCEPTION_DETAIL -o ELLIPSIS tests/*.txt

# Run the test suite with all supported Python versions on Linux.
# Only run these tests for master since they're so slow on Travis.
- env: TASK=pytest PYVER=2.7.14
# Enable coverage for the latest stable CPython 2 and 3 releases and PyPy on Linux.
- env: TASK=pytest PYVER=2.7.14 COVERAGE=1
if: branch = master
- env: TASK=pytest PYVER=3.4.7
if: branch = master
- env: TASK=pytest PYVER=3.5.3
if: branch = master
# Enable coverage for the latest stable Python 3 release on Linux.
- env: TASK=pytest PYVER=3.6.3 COVERAGE=1
if: branch = master
before_script: travis_retry pip install -e .[coverage]
script:
- |
py.test --cov=bidict --cov-config=.coveragerc || exit 1
travis_retry pip install coveralls || exit 1
coveralls
- env: TASK=pytest PYVER=3.7-dev
if: branch = master
- env: TASK=pytest PYVER=pypy2.7-5.9.0
if: branch = master
- env: TASK=pytest PYVER=pypy3.5-5.9.0
- env: TASK=pytest PYVER=pypy3.5-5.9.0 COVERAGE=1
if: branch = master

# Run the test suite with all supported Python versions on macOS.
Expand Down Expand Up @@ -121,11 +116,23 @@ before_install:
echo "VIRTUAL_ENV=$VIRTUAL_ENV"
install:
- travis_retry pip install -e .[test]
- if [[ -n $COVERAGE ]]; then EXTRAS="test,coverage"; else EXTRAS="test"; fi
- travis_retry pip install .[$EXTRAS]
- py.test --version

script:
- py.test
- if [[ -n $COVERAGE ]]; then COVARGS="--cov=bidict --cov-config=.coveragerc"; fi
- py.test $COVARGS

after_success:
- |
if [[ -f .coverage ]]; then
echo "Installing codecov..."
travis_retry pip install codecov || exit 1
echo
echo "Uploading coverage report..."
codecov || exit 1
fi
before_cache:
- rm -rf $HOME/.cache/pip/log
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -32,8 +32,8 @@ Status
:target: https://ci.appveyor.com/project/jab/bidict
:alt: AppVeyor build status (Windows)

.. image:: https://coveralls.io/repos/jab/bidict/badge.svg?branch=master
:target: https://coveralls.io/github/jab/bidict
.. image:: https://codecov.io/gh/jab/bidict/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jab/bidict
:alt: Test coverage

.. image:: https://api.codacy.com/project/badge/Grade/6628756a73254cd895656348236833b8
Expand Down Expand Up @@ -66,7 +66,7 @@ Bidict:
- has carefully designed APIs for
safety, simplicity, flexibility, and ergonomics,
- is CPython-, PyPy-, Python 2-, and Python 3-compatible,
- has extensive `test coverage <https://coveralls.io/github/jab/bidict>`_,
- has extensive `test coverage <https://codecov.io/gh/jab/bidict>`_,
including property-based tests and benchmarks,
which are run continuously on all supported Python versions and OSes,
- integrates with Python’s collections interfaces and abstract base classes,
Expand Down

0 comments on commit 92b3e9c

Please sign in to comment.