Skip to content

Commit 0f95c61

Browse files
committed
(ci/test): add CodeCov test coverage reporting
- add after_script to upload coverage report - add XML output pytest.ini as CodeCov requires it - gitignore XML output (docs): add dat slick coverage badge to README
1 parent 4a8ea6d commit 0f95c61

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ poetry.lock
77
.pytest_cache/
88
.coverage
99
htmlcov/
10+
coverage.xml
1011

1112
# Created by https://www.gitignore.io/api/python
1213

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ before_install: pip install poetry
55
install: poetry install
66

77
script: poetry run pytest tests/test_project/
8+
# upload coverage reports to CodeCov
9+
after_script: bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
[![dw](https://img.shields.io/pypi/dw/django-serializable-model.svg)](https://pypi.org/project/django-serializable-model/)
1010
<br><!-- status / activity -->
1111
[![build status](https://img.shields.io/travis/agilgur5/django-serializable-model/master.svg)](https://travis-ci.org/agilgur5/django-serializable-model)
12+
[![code coverage](https://img.shields.io/codecov/c/gh/agilgur5/django-serializable-model/master.svg)](https://codecov.io/gh/agilgur5/django-serializable-model)
1213
<br>
1314
Django classes to make your models, managers, and querysets serializable, with built-in support for related objects in ~100 LoC (shorter than this README!)
1415

tests/test_project/pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ addopts = --cov django_serializable_model
55
--cov-branch
66
--cov-report term-missing
77
--cov-report html
8+
--cov-report xml

0 commit comments

Comments
 (0)