Skip to content

Coverage config #8003

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

Merged
merged 3 commits into from
Feb 4, 2017
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
6 changes: 1 addition & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
source=
matplotlib
mpl_toolkits
[report]
omit =
lib/matplotlib/tests/*
lib/matplotlib/testing/*
lib/mpl_toolkits/tests/*

[report]
exclude_lines =
raise NotImplemented
def __str__
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ install:
pip install --upgrade setuptools
- |
# Install dependencies from pypi
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS cycler coveralls coverage $MOCK
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS cycler codecov coverage $MOCK
pip install $PRE -r doc-requirements.txt

# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
Expand Down Expand Up @@ -198,8 +198,7 @@ after_failure:
after_success:
- |
if [[ $BUILD_DOCS == false ]]; then
coveralls
bash <(curl -s https://codecov.io/bash)
codecov -e TRAVIS_PYTHON_VERSION
fi
- |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' && $BUILD_DOCS == true && $TRAVIS_BRANCH == 'master' ]]; then
Expand Down
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ environment:
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"
# Workaround for https://github.com/conda/conda-build/issues/636
PYTHONIOENCODING: "UTF-8"
PYTEST_ARGS: -ra --timeout=300 --durations=25 -n %NUMBER_OF_PROCESSORS% #--cov-report= --cov=lib
PYTEST_ARGS: -ra --timeout=300 --durations=25 -n %NUMBER_OF_PROCESSORS% --cov-report= --cov=lib
USE_PYTEST: no
PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky collection order
# https://github.com/pytest-dev/pytest/issues/920
Expand Down Expand Up @@ -140,6 +140,8 @@ test_script:
- if x%USE_PYTEST% == xno python tests.py %PYTEST_ARGS%
# Generate a html for visual tests
- python visual_tests.py
- if x%USE_PYTEST% == xyes pip install codecov
- if x%USE_PYTEST% == xyes codecov -e PYTHON_VERSION PLATFORM
Copy link
Member

@dstansby dstansby Feb 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines mean that codecov only happens if USE_PYTEST is true, which is only for the one build. pytest is still being run in the other builds, just through tests.py in the root which calls test() in matplotlib/__init__.py.

I don't know if running the tests using test.py collects coverage, but if it does I guess these if statements can just go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, these conditions could be dropped.


after_test:
# After the tests were a success, build packages (wheels and conda)
Expand Down Expand Up @@ -175,6 +177,8 @@ artifacts:
name: result_images
type: zip

on_finish:

on_failure:
- python visual_tests.py
- echo zipping images after a failure...
Expand Down
25 changes: 25 additions & 0 deletions ci/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# codecov can find this file anywhere in the repo, so we don't need to clutter
# the root folder.
comment: false

codecov:
notify:
require_ci_to_pass: no

coverage:
status:
patch:
default:
target: '80'
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
project:
default: false
library:
target: auto
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
paths: '!lib/.*/tests/.*'

tests:
target: 97.7%
paths: 'lib/.*/tests/.*'