Skip to content

Commit e817126

Browse files
authored
Merge branch 'master' into tag-tests
2 parents c320bc7 + 22b14e3 commit e817126

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ jobs:
1818
run: docker-compose up -d web
1919

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

2423
- name: Check Migrations are up-to-date
2524
run: docker-compose run -T --rm app ./manage.py makemigrations --check
26-
if: always()
25+
26+
- name: Upload coverage report to codecov
27+
uses: codecov/codecov-action@v1
28+
with:
29+
file: ./project/coverage.xml

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Django proof-of-concept for CodeBuddies V3
22

33
![Test](https://github.com/codebuddies/django-concept/workflows/Test/badge.svg)
4+
[![codecov](https://codecov.io/gh/codebuddies/backend/branch/master/graph/badge.svg)](https://codecov.io/gh/codebuddies/backend)
5+
6+
7+
48

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

@@ -104,6 +108,7 @@ docker-compose run --rm app ./manage.py help
104108
* 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.
105109
* Please add tests for your code when contributing.
106110
* Run the test suite using `docker-compose run --rm app pytest`
111+
* With test coverage report `docker-compose run --rm app pytest --cov-report=term --cov=.`
107112

108113
### Import Postman collection
109114
Postman is a free interactive tool for verifying the APIs of your project. You can download it at postman.com/downloads.

project/.coveragerc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
[run]
2-
include = project/*
3-
omit = *migrations*, *tests*
2+
omit =
3+
*/apps.py,
4+
*/config/*,
5+
*/migrations/*,
6+
*/tests/*,
7+
*/tests.py,
8+
*/*.html,
9+
conftest.py,
10+
manage.py,
411
plugins =
512
django_coverage_plugin

project/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ COPY ./requirements/ /opt/codebuddies/requirements/
88

99
RUN python3 -m pip install --upgrade pip
1010
RUN pip3 install -r /opt/codebuddies/requirements/local.txt
11+
RUN pip3 check
1112

1213
RUN groupadd -r uwsgi && useradd -r -g uwsgi uwsgi
1314

project/requirements/local.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2
99
# ------------------------------------------------------------------------------
1010
mypy==0.720 # https://github.com/python/mypy
1111
pytest==5.1.1 # https://github.com/pytest-dev/pytest
12+
pytest-cov==2.8.1 # https://github.com/pytest-dev/pytest-cov
1213
pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar
1314

1415
# Code quality

0 commit comments

Comments
 (0)