Skip to content

Commit

Permalink
Setup coverage analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
krzys-h committed Dec 29, 2020
1 parent 9f1cb1e commit 0b6a9ea
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
source = .
omit =
./venv/*
./gallery/*
./wwwapp/migrations/*
./wwwapp/wsgi.py
./manage.py
./make_plan.py
./htmlcov/*
plugins =
django_coverage_plugin
relative_files = True

[report]
show_missing = True
skip_covered = True
11 changes: 10 additions & 1 deletion .github/workflows/pythontest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@ jobs:
- name: Django migrations
run: ./manage.py makemigrations --check --dry-run
- name: Django test
run: ./manage.py test wwwapp -v 2
run: coverage run ./manage.py test wwwapp -v 2
- name: Generate coverage report
run: coverage xml
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
verbose: true
if: matrix.python-version == 3.8
5 changes: 5 additions & 0 deletions coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
coverage erase
coverage run manage.py test wwwapp
coverage report
coverage html
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ social-auth-app-django
psycopg2
mock
freezegun
coverage
django_coverage_plugin
1 change: 1 addition & 0 deletions wwwapp/settings_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
SECRET_KEY = ')_7av^!cy(wfx=k#3*7x+(=j^fzv+ot^1@sh9s9t=8$bu@r(z$'

DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
ALLOWED_HOSTS = ["*"]

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Expand Down

0 comments on commit 0b6a9ea

Please sign in to comment.