Enforce a 95% combined coverage floor in CI and local runs.
Test Python Package / unit-tests (pull_request) Failing after 56s
Code Quality Pipeline / code-quality (pull_request) Successful in 1m36s
Test Python Package / integration-tests (pull_request) Failing after 1m14s
Test Python Package / coverage-report (pull_request) Has been skipped
PR Title Check / check-title (pull_request) Successful in 35s
Test Python Package / unit-tests (pull_request) Failing after 56s
Code Quality Pipeline / code-quality (pull_request) Successful in 1m36s
Test Python Package / integration-tests (pull_request) Failing after 1m14s
Test Python Package / coverage-report (pull_request) Has been skipped
PR Title Check / check-title (pull_request) Successful in 35s
Configure fail_under in pyproject.toml and read it in the coverage-report workflow so the threshold stays in one place. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
co-authored by
Cursor
parent
e39fc96ac1
commit
5393efc6cd
@@ -112,8 +112,21 @@ jobs:
|
||||
- name: Combine coverage report
|
||||
run: |
|
||||
uv run coverage combine coverage-unit/.coverage coverage-integration/.coverage
|
||||
uv run coverage report -m --include='python_repositories/*' > coverage.txt
|
||||
cat coverage.txt
|
||||
uv run coverage report -m --include='python_repositories/*' --fail-under=0 > coverage.txt
|
||||
|
||||
- name: Show coverage report
|
||||
run: cat coverage.txt
|
||||
|
||||
- name: Enforce coverage floor
|
||||
run: |
|
||||
FAIL_UNDER=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['tool']['coverage']['report']['fail_under'])")
|
||||
echo "Checking combined coverage against ${FAIL_UNDER}% floor..."
|
||||
if uv run coverage report --fail-under="$FAIL_UNDER" --include='python_repositories/*'; then
|
||||
echo "Coverage floor met."
|
||||
else
|
||||
echo "::error::Combined coverage is below the ${FAIL_UNDER}% floor"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Post coverage summary to PR
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
Reference in New Issue
Block a user