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

WIP Coverage reports #122

Merged
merged 4 commits into from
Mar 29, 2020
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
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ jobs:
run: docker-compose up -d web

- name: Run test suite
run: docker-compose run -T --rm app pytest -v
if: always()
run: docker-compose run -T --rm app pytest -v --cov-report=xml --cov=.

- name: Check Migrations are up-to-date
run: docker-compose run -T --rm app ./manage.py makemigrations --check
if: always()

- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1
with:
file: ./project/coverage.xml
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Django proof-of-concept for CodeBuddies V3

![Test](https://github.com/codebuddies/django-concept/workflows/Test/badge.svg)
[![codecov](https://codecov.io/gh/codebuddies/backend/branch/master/graph/badge.svg)](https://codecov.io/gh/codebuddies/backend)




Background: https://github.com/codebuddies/codebuddies/issues/1136

Expand Down Expand Up @@ -104,6 +108,7 @@ docker-compose run --rm app ./manage.py help
* We use [pytest](https://docs.pytest.org/en/latest/contents.html) with the [pytest-django](https://pytest-django.readthedocs.io/en/latest/) plugin for running tests.
* Please add tests for your code when contributing.
* Run the test suite using `docker-compose run --rm app pytest`
* With test coverage report `docker-compose run --rm app pytest --cov-report=term --cov=.`

### Import Postman collection
Postman is a free interactive tool for verifying the APIs of your project. You can download it at postman.com/downloads.
Expand Down
11 changes: 9 additions & 2 deletions project/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[run]
include = project/*
omit = *migrations*, *tests*
omit =
*/apps.py,
*/config/*,
*/migrations/*,
*/tests/*,
*/tests.py,
*/*.html,
conftest.py,
manage.py,
plugins =
django_coverage_plugin
1 change: 1 addition & 0 deletions project/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2
# ------------------------------------------------------------------------------
mypy==0.720 # https://github.com/python/mypy
pytest==5.1.1 # https://github.com/pytest-dev/pytest
pytest-cov==2.8.1 # https://github.com/pytest-dev/pytest-cov
pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar

# Code quality
Expand Down