From 1e284d90926da16da8fa22414a27aed0100b1d9c Mon Sep 17 00:00:00 2001 From: Srinivas Chippagiri Date: Sat, 24 Oct 2026 14:08:27 -0700 Subject: [PATCH] ci: report test coverage in the unit test job Add pytest-cov and run the unit tests with --cov, printing per-file coverage with missing lines in the CI log. Coverage settings live in setup.cfg. Closes #142 Signed-off-by: Srinivas Chippagiri --- .github/workflows/code_quality.yml | 2 +- setup.cfg | 6 ++++++ test-requirements.txt | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index fd1bce8..57f95ee 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -52,7 +52,7 @@ jobs: pip install -r test-requirements.txt - name: Run tests run: | - pytest --ignore tests/smoketests + pytest --ignore tests/smoketests --cov --cov-report=term-missing backendSmoketests: name: Individual Backend Smoketests diff --git a/setup.cfg b/setup.cfg index 55f25fe..4520dad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,3 +9,9 @@ license_files = LICENSE NOTICE long_description=file: README.rst + +[coverage:run] +source = json_logging + +[coverage:report] +show_missing = True diff --git a/test-requirements.txt b/test-requirements.txt index d118997..a6e560c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,4 +10,5 @@ gunicorn httpx flake8 pytest +pytest-cov -e .