From 18195df9de13fec20f4e27483443c3d9bdcabf30 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 31 Jan 2017 11:15:12 -0700 Subject: [PATCH 1/3] MNT: Replace use of coveralls utility with codecov. --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a544ff11c67f..d1b0008ec22b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 From 12691f11219604d8bcd5885aaff32e97dda7865d Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 31 Jan 2017 11:17:38 -0700 Subject: [PATCH 2/3] ENH: Submit coverage on AppVeyor. This way we can get coverage for platform-dependant lines. --- appveyor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6dfd857838df..7d00b1c51f89 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 @@ -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 after_test: # After the tests were a success, build packages (wheels and conda) @@ -175,6 +177,8 @@ artifacts: name: result_images type: zip +on_finish: + on_failure: - python visual_tests.py - echo zipping images after a failure... From f78c205af0768afec072afb5c9467f31f7e54384 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 31 Jan 2017 11:23:35 -0700 Subject: [PATCH 3/3] ENH: Update codecov.io configuration This sets it to report even if CI fails (just to get to see numbers). Separate out coverage for lines in tests (which should be 100%, but is currently ~97.7%), versus those in the library itself. --- .coveragerc | 6 +----- ci/codecov.yml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.coveragerc b/.coveragerc index 7ab50a9a0019..e2b69ce54b7f 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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__ diff --git a/ci/codecov.yml b/ci/codecov.yml index ca6198fc3a18..500b4a9f0d63 100644 --- a/ci/codecov.yml +++ b/ci/codecov.yml @@ -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/.*'