Document where combined coverage floor is enforced in CI.
Test Python Package / unit-tests (pull_request) Successful in 13s
Code Quality Pipeline / code-quality (pull_request) Successful in 26s
PR Title Check / check-title (pull_request) Successful in 6s
Test Python Package / integration-tests (pull_request) Successful in 1m7s
Test Python Package / coverage-report (pull_request) Failing after 15s
Test Python Package / unit-tests (pull_request) Successful in 13s
Code Quality Pipeline / code-quality (pull_request) Successful in 26s
PR Title Check / check-title (pull_request) Successful in 6s
Test Python Package / integration-tests (pull_request) Successful in 1m7s
Test Python Package / coverage-report (pull_request) Failing after 15s
Clarify that unit and integration jobs skip the floor check because they only produce partial coverage. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
co-authored by
Cursor
parent
34632980ba
commit
5c8cd841b6
@@ -28,6 +28,7 @@ jobs:
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
# --cov-fail-under=0: partial coverage only; floor is checked in coverage-report.
|
||||
uv run pytest tests/unit/ -m "not integration" \
|
||||
--cov=python_repositories \
|
||||
--cov-report= \
|
||||
@@ -65,6 +66,7 @@ jobs:
|
||||
|
||||
- name: Run integration tests
|
||||
run: |
|
||||
# --cov-fail-under=0: partial coverage only; floor is checked in coverage-report.
|
||||
uv run pytest -m integration \
|
||||
--cov=python_repositories \
|
||||
--cov-report= \
|
||||
@@ -79,6 +81,7 @@ jobs:
|
||||
compression-level: 0
|
||||
|
||||
coverage-report:
|
||||
# Merges unit + integration coverage and enforces fail_under from pyproject.toml.
|
||||
needs: [unit-tests, integration-tests]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'push'
|
||||
@@ -113,6 +116,7 @@ jobs:
|
||||
|
||||
- name: Combine coverage report
|
||||
run: |
|
||||
# --fail-under=0 so the full report is always written before the floor check.
|
||||
uv run coverage combine coverage-unit/.coverage coverage-integration/.coverage
|
||||
uv run coverage report -m --include='python_repositories/*' --fail-under=0 > coverage.txt
|
||||
|
||||
@@ -121,6 +125,7 @@ jobs:
|
||||
|
||||
- name: Enforce coverage floor
|
||||
run: |
|
||||
# Reads fail_under from pyproject.toml; only combined coverage is evaluated here.
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user