mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
ci: measure coverage and fail below 50%
The test step runs under coverage and reports files that are not fully covered. pyproject.toml holds the configuration and the floor: 51% measured without the live libvirt suite on 2026-10-03, floor 50% to absorb differences between Python versions. With the live suite against a real host the same code is 69% covered.
This commit is contained in:
parent
63b9f86436
commit
6f12da4857
2 changed files with 12 additions and 2 deletions
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
|
@ -56,9 +56,11 @@ jobs:
|
||||||
- name: Run Django Migrations
|
- name: Run Django Migrations
|
||||||
run: python manage.py migrate --noinput
|
run: python manage.py migrate --noinput
|
||||||
|
|
||||||
# Includes the vrtManager tests
|
# Includes the vrtManager tests; fails below the coverage floor in pyproject.toml
|
||||||
- name: Run Test Suite
|
- name: Run Test Suite
|
||||||
run: python manage.py test
|
run: |
|
||||||
|
coverage run manage.py test
|
||||||
|
coverage report --skip-covered
|
||||||
|
|
||||||
- name: Validate OpenAPI Schema
|
- name: Validate OpenAPI Schema
|
||||||
run: python manage.py spectacular --validate --fail-on-warn --file /dev/null
|
run: python manage.py spectacular --validate --fail-on-warn --file /dev/null
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,11 @@ select = ["E9", "F"]
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
# Settings overlay: re-exports the base settings by design.
|
# Settings overlay: re-exports the base settings by design.
|
||||||
"webvirtcloud/settings-dev.py" = ["F403", "F405"]
|
"webvirtcloud/settings-dev.py" = ["F403", "F405"]
|
||||||
|
|
||||||
|
[tool.coverage.run]
|
||||||
|
source = ["."]
|
||||||
|
omit = [".venv/*", "*/migrations/*", "*/test*.py", "*/tests.py", "manage.py", "webvirtcloud/settings*.py"]
|
||||||
|
|
||||||
|
[tool.coverage.report]
|
||||||
|
# Measured 51% without the live libvirt suite (2026-10-03); raise as tests grow.
|
||||||
|
fail_under = 50
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue