Skip to content
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

Run coverage on travis #4605

Merged
merged 7 commits into from
Oct 22, 2018
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
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
comment:
layout: "diff, files"
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -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__.:
1 change: 1 addition & 0 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 12 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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