Add coverage reports

This commit is contained in:
Jake Howard 2022-08-17 19:09:07 +01:00
parent c26397ae8d
commit 9f2b2a81c9
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 21 additions and 1 deletions

View file

@ -68,7 +68,15 @@ test_python:
DATABASE_URL: postgres://postgres@postgres/postgres DATABASE_URL: postgres://postgres@postgres/postgres
script: script:
- ./manage.py collectstatic --noinput --clear - ./manage.py collectstatic --noinput --clear
- ./manage.py test - coverage run ./manage.py test
- coverage report
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
<<: *python_test_template <<: *python_test_template
dependencies: dependencies:
- pip - pip

View file

@ -26,6 +26,11 @@ build:
test *ARGS: test *ARGS:
./manage.py test {{ ARGS }} ./manage.py test {{ ARGS }}
coverage:
coverage run ./manage.py test --keepdb
coverage report
coverage html
format: format:
black . black .
isort . isort .

View file

@ -13,3 +13,4 @@ mypy
curlylint curlylint
djhtml djhtml
wagtail-factories wagtail-factories
coverage

View file

@ -15,6 +15,7 @@ build==0.8.0 # via pip-tools
certifi==2022.6.15 # via -r requirements/base.txt, requests certifi==2022.6.15 # via -r requirements/base.txt, requests
charset-normalizer==2.1.0 # via -r requirements/base.txt, requests charset-normalizer==2.1.0 # via -r requirements/base.txt, requests
click==8.1.3 # via -r requirements/base.txt, black, curlylint, pip-tools, rq click==8.1.3 # via -r requirements/base.txt, black, curlylint, pip-tools, rq
coverage==6.4.4 # via -r requirements/dev.in
curlylint==0.13.1 # via -r requirements/dev.in curlylint==0.13.1 # via -r requirements/dev.in
deprecated==1.2.13 # via -r requirements/base.txt, redis deprecated==1.2.13 # via -r requirements/base.txt, redis
django==4.0.6 # via -r requirements/base.txt, django-browser-reload, django-debug-toolbar, django-filter, django-htmx, django-modelcluster, django-permissionedforms, django-redis, django-rq, django-taggit, django-treebeard, djangorestframework, wagtail django==4.0.6 # via -r requirements/base.txt, django-browser-reload, django-debug-toolbar, django-filter, django-htmx, django-modelcluster, django-permissionedforms, django-redis, django-rq, django-taggit, django-treebeard, djangorestframework, wagtail

View file

@ -24,3 +24,8 @@ skip_glob=env/*
[flake8] [flake8]
extend_ignore=E128,E501 extend_ignore=E128,E501
extend_exclude=env extend_exclude=env
[coverage:report]
exclude_lines =
pragma: no cover
if settings.DEBUG