[tests,dependencies] install and configure coverage reports
The reports will be printed on the terminal and written in xml. A new just recipe is added as well: `just cov` closes: #9
This commit is contained in:
parent
fe28b914be
commit
60344a0cf5
5 changed files with 26 additions and 2 deletions
|
@ -23,7 +23,7 @@ steps:
|
||||||
- python -m venv venv
|
- python -m venv venv
|
||||||
- . venv/bin/activate
|
- . venv/bin/activate
|
||||||
- python -m pip install --disable-pip-version-check --no-input --quiet -r requirements/test.txt
|
- python -m pip install --disable-pip-version-check --no-input --quiet -r requirements/test.txt
|
||||||
- python -m pytest
|
- python -m pytest --cov --cov-report term
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: database
|
- name: database
|
||||||
|
|
2
justfile
2
justfile
|
@ -24,4 +24,6 @@ serve:
|
||||||
test *ARGS:
|
test *ARGS:
|
||||||
ENV_PATH=.env.test python -m pytest {{ARGS}}
|
ENV_PATH=.env.test python -m pytest {{ARGS}}
|
||||||
|
|
||||||
|
cov *ARGS:
|
||||||
|
just test --cov --cov-report xml --cov-report term --junitxml=reports/junit/junit.xml {{ARGS}}
|
||||||
alias fd := freshdeps
|
alias fd := freshdeps
|
||||||
|
|
|
@ -24,6 +24,25 @@ addopts = [
|
||||||
"--capture=sys",
|
"--capture=sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.coverage]
|
||||||
|
branch = true
|
||||||
|
|
||||||
|
[tool.coverage.report]
|
||||||
|
skip_covered = true
|
||||||
|
skip_empty = true
|
||||||
|
show_missing = true
|
||||||
|
|
||||||
|
[tool.coverage.run]
|
||||||
|
omit = [
|
||||||
|
"*/migrations/*",
|
||||||
|
"VERSION.py",
|
||||||
|
"manage.py",
|
||||||
|
"config/[aw]sgi.py",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.coverage.xml]
|
||||||
|
output = "reports/coverage/coverage.xml"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["pdm-backend"]
|
requires = ["pdm-backend"]
|
||||||
build-backend = "pdm.backend"
|
build-backend = "pdm.backend"
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
hypothesis[django]
|
hypothesis[django]
|
||||||
pytest
|
pytest
|
||||||
pytest-django
|
pytest-django
|
||||||
|
pytest-cov
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# SHA1:9bf147356ad56dbe073ef0973141bdfb94631c9b
|
# SHA1:5d0aacdba01d54c2715a30c8df5ee5aef977d83c
|
||||||
#
|
#
|
||||||
# This file is autogenerated by pip-compile-multi
|
# This file is autogenerated by pip-compile-multi
|
||||||
# To update, run:
|
# To update, run:
|
||||||
|
@ -7,10 +7,12 @@
|
||||||
#
|
#
|
||||||
-r prod.txt
|
-r prod.txt
|
||||||
attrs==25.3.0
|
attrs==25.3.0
|
||||||
|
coverage==7.7.0
|
||||||
hypothesis==6.129.3
|
hypothesis==6.129.3
|
||||||
iniconfig==2.0.0
|
iniconfig==2.0.0
|
||||||
packaging==24.2
|
packaging==24.2
|
||||||
pluggy==1.5.0
|
pluggy==1.5.0
|
||||||
pytest==8.3.5
|
pytest==8.3.5
|
||||||
|
pytest-cov==6.0.0
|
||||||
pytest-django==4.10.0
|
pytest-django==4.10.0
|
||||||
sortedcontainers==2.4.0
|
sortedcontainers==2.4.0
|
||||||
|
|
Loading…
Add table
Reference in a new issue