From 8d23749efc9d3a98a9ab3868db3c1de93271477a Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 31 Jul 2024 08:42:54 +0200 Subject: [PATCH 1/4] Use Markdown for coverage table --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9317c6ea..a95691b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: python -Im coverage json # Report and write to summary. - python -Im coverage report --skip-covered --skip-empty | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY + python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") echo "total=$TOTAL" >> $GITHUB_ENV From 0ae37d681535b329a56abbc9387e9b8d9f7473a3 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 31 Jul 2024 08:54:20 +0200 Subject: [PATCH 2/4] Use config --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e63f49ff..92617b60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,9 +103,13 @@ addopts = "-l --benchmark-sort=fullname --benchmark-warmup=true --benchmark-warm [tool.coverage.run] parallel = true +branch = true source_pkgs = ["cattrs", "tests"] [tool.coverage.report] +show_missing = true +skip_covered = true +skip_empty = true exclude_also = [ "@overload", "if TYPE_CHECKING:", From 2a9ff8ed6104190b8cdf41c7afed25c814c01a0f Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 31 Jul 2024 08:54:49 +0200 Subject: [PATCH 3/4] html too --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a95691b8..d3bf5465 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,7 @@ jobs: - name: "Combine coverage" run: | python -Im coverage combine - python -Im coverage html --skip-covered --skip-empty + python -Im coverage html python -Im coverage json # Report and write to summary. From 9ec4b4939803f9ac37fc14953cfd8a41f623bb44 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 31 Jul 2024 09:05:35 +0200 Subject: [PATCH 4/4] Don't measure branch coverage for now --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 92617b60..7288ceef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,6 @@ addopts = "-l --benchmark-sort=fullname --benchmark-warmup=true --benchmark-warm [tool.coverage.run] parallel = true -branch = true source_pkgs = ["cattrs", "tests"] [tool.coverage.report]