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/.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 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... 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/.*'