Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,24 @@ django-test:
POSTGRES_HOST: "postgres"
POSTGRES_PORT: "5432"
script:
- uv run manage.py test
- uv run coverage run manage.py test --no-input --keepdb --timing --buffer || TEST_EXIT=$?
- uv run coverage combine
- uv run coverage report
- uv run coverage xml
- uv run coverage html
- exit ${TEST_EXIT:-0}
coverage: '/TOTAL.*? (100(?:\.0+)?|[1-9]?\d(?:\.\d+)?)\%$/'
after_script:
- uv cache prune --ci
artifacts:
expire_in: 1 week
when: always
paths:
- htmlcov/
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml

deploy-check:
stage: test
Expand Down
48 changes: 47 additions & 1 deletion django/{{ cookiecutter.project_slug }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,53 @@ dependencies = [
[dependency-groups]
dev = [
"pre-commit>=4.6.0",
"coverage>=7.17.4",
]
production = [
"gunicorn>=26.0.0",
]
]

[tool.coverage.run]
source = ["."]
branch = true
relative_files = true
parallel = true
concurrency = ["multiprocessing"]

omit = [
"*/migrations/*",
"*/tests/*",
"*/tests.py",
"manage.py",
"*/asgi.py",
"*/wsgi.py",
"*/settings/*",
"*/settings.py",
".venv/*",
]

[tool.coverage.report]
skip_covered = true
skip_empty = true
precision = 1

exclude_also = [
"def __repr__",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"raise NotImplementedError",
"raise AssertionError",
"if settings.DEBUG",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
"class .*\\bProtocol\\):",
"^\\s*\\.\\.\\.$",
]


[tool.coverage.html]
directory = "htmlcov"
show_contexts = true

[tool.coverage.xml]
output = "coverage.xml"
Loading