Merge pull request #4605 from stsewd/run-coverage

Run coverage on travis
humitos/integrations/handle-error-codes
Santos Gallegos 2018-10-22 10:53:44 -05:00 committed by GitHub
commit a4291d1772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 8 deletions

2
.codecov.yml Normal file
View File

@ -0,0 +1,2 @@
comment:
layout: "diff, files"

View File

@ -1,3 +1,19 @@
[run]
branch = true
source = .
omit =
*/**/migrations/*
*/**/management/commands/*
*/**/settings/*
*/**/settings.py
analytics/vendor/*
rtd_tests/*
*/**/tests/**
wsgi.py
[report]
exclude_lines =
if self.debug:
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:

View File

@ -5,6 +5,7 @@ pytest==3.7.4
pytest-django==3.4.2
pytest-describe==0.11.1
pytest-xdist==1.23.0
pytest-cov
apipkg==1.5
execnet==1.5.0

20
tox.ini
View File

@ -6,7 +6,7 @@ skipsdist = True
[travis]
python =
2.7: py27
3.6: py36
3.6: py36, codecov
[testenv]
description = run test suite for the application with {basepython}
@ -16,10 +16,11 @@ setenv =
LANG=C
LC_CTYPE=C.UTF-8
DJANGO_SETTINGS_SKIP_LOCAL=True
passenv = CI TRAVIS TRAVIS_*
deps = -r{toxinidir}/requirements/testing.txt
changedir = {toxinidir}/readthedocs
commands =
py.test {posargs}
py.test --cov-report= --cov-config {toxinidir}/.coveragerc --cov=. {posargs}
[testenv:docs]
description = build readthedocs documentation
@ -53,12 +54,15 @@ commands =
npm run lint
[testenv:coverage]
description = run test suite with code coverage for the application with {basepython}
deps =
-r{toxinidir}/requirements/testing.txt
pytest-cov
description = shows the coverage report
deps = coverage
whitelist_externals = echo
commands =
py.test --disable-pytest-warnings \
--cov-report=term --cov-report=html --cov-config {toxinidir}/.coveragerc --cov=. {posargs}
coverage report --show-missing
coverage html
echo Annotated HTML coverage report is in {toxinidir}/readthedocs/htmlcov/index.html
[testenv:codecov]
description = upload coverage report
deps = codecov
commands = codecov