From 3262f174588e00f64698b991322723acfcd0d058 Mon Sep 17 00:00:00 2001 From: Dotty Dotter Date: Tue, 28 Apr 2026 02:05:39 +0200 Subject: [PATCH] build(#134): Coverage-Baseline (.coveragerc) + pytest-cov in dev-deps Phase 3 von #134 / ADR 0007: 60%-Mindestschwelle pro Default-Lauf, mit show_missing fuer schnelle Lueckenanalyse. Konfiguration: - source = app, omits Hilfs-Skripte (reindex_embeddings, sync_abgeordnetenwatch) - exclude_lines: __repr__, NotImplementedError, __main__-Block, TYPE_CHECKING, Ellipsis-Stubs - htmlcov-Ordner via .gitignore ausgeschlossen Aufruf: pytest --cov=app --cov-report=term-missing pytest --cov=app --cov-report=html # detaillierte HTML-Ansicht in htmlcov/ ADR 0007 (Test-Taxonomie) erklaert das Gesamtschema. --- .coveragerc | 30 ++++++++++++++++++++++++++++++ .gitignore | 4 ++++ requirements-dev.txt | 1 + 3 files changed, 35 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..a054c1b --- /dev/null +++ b/.coveragerc @@ -0,0 +1,30 @@ +[run] +source = app +omit = + # Hilfs-Skripte und Migrations-Tools — nicht produktiver Code + app/reindex_embeddings.py + app/sync_abgeordnetenwatch.py + # Generated / Auto-Discovery + app/__init__.py + +[report] +# Faustregel ADR 0007: keine 100%-Jagd, aber 70% pro Kern-Modul ist +# der Mindeststandard. Der show_missing-Flag macht Luecken im CI-Output +# sofort sichtbar. +show_missing = true +skip_covered = false +precision = 1 +fail_under = 60 + +# Zeilen, die nicht gezaehlt werden sollen — typische Boilerplate ohne +# eigentliche Testbarkeit. +exclude_lines = + pragma: no cover + def __repr__ + raise NotImplementedError + if __name__ == .__main__.: + if TYPE_CHECKING: + \.\.\. + +[html] +directory = htmlcov diff --git a/.gitignore b/.gitignore index 4eae9af..f124ae5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,8 @@ reports/ .DS_Store Thumbs.db site/ + +# Coverage reports (Phase 3 von #134, ADR 0007) .coverage +.coverage.* +htmlcov/ diff --git a/requirements-dev.txt b/requirements-dev.txt index 0f66d22..13fe0ea 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,3 +11,4 @@ pytest>=8.0.0 pytest-asyncio>=0.24.0 +pytest-cov>=5.0.0