Skip to content

Commit 5814a7a

Browse files
committed
Fix CI coverage reporting and cov config
Update GitHub Actions and tox/pyproject coverage settings so coverage output is picked up reliably. Read the tox output from tox-output.log and point the codecov action at ./.coverage.py312.xml. Stop excluding site-packages in pyproject (commented out) because it caused our installed package to be omitted from reports. Also tidy tox.ini coverage command formatting and ensure XML/term reports are emitted per envname.
1 parent c89d166 commit 5814a7a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/testing-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ jobs:
6464
echo "## Coverage Summary" >> "$GITHUB_STEP_SUMMARY"
6565
echo '```text' >> "$GITHUB_STEP_SUMMARY"
6666
# Pull the coverage table from tox output:
67-
sed -n '/^Name\s\+Stmts\s\+Miss\s\+Cover/,$p' tox-output.txt >> "$GITHUB_STEP_SUMMARY" || true
67+
sed -n '/^Name\s\+Stmts\s\+Miss\s\+Cover/,$p' tox-output.log >> "$GITHUB_STEP_SUMMARY" || true
6868
echo '```' >> "$GITHUB_STEP_SUMMARY"
6969
7070
7171
- name: Upload coverage to Codecov
7272
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12' && github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'master')
7373
uses: codecov/codecov-action@v5
7474
with:
75-
files: ./coverage.py312.xml
75+
files: ./.coverage.py312.xml
7676
fail_ci_if_error: true

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ omit = [
139139
branch = true
140140
omit = [
141141
"*/__pycache__/*",
142-
"*/site-packages/*",
142+
# "*/site-packages/*",
143+
# breaks CI coverage reporting as it excludes our own installed package
143144
]
144145
source = [ "dlclivegui", "tests" ]

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ setenv =
2424
# Keep behavior aligned with your GitHub Actions job:
2525
commands =
2626
pytest -m "not hardware" --maxfail=1 --disable-warnings \
27-
--cov=dlclivegui
28-
--cov-report=xml:{toxinidir}/.coverage.{envname}.xml
29-
--cov-report=term-missing
27+
--cov=dlclivegui \
28+
--cov-report=xml:{toxinidir}/.coverage.{envname}.xml \
29+
--cov-report=term-missing \
3030
{posargs}
3131

3232
# Let CI variables pass through (useful for debugging and some GUI/headless setups):

0 commit comments

Comments
 (0)