Skip to content

feat: add Python test coverage#4841

Merged
fernandolins merged 4 commits into
mainfrom
feat/python-test-coverage-4838
May 16, 2026
Merged

feat: add Python test coverage#4841
fernandolins merged 4 commits into
mainfrom
feat/python-test-coverage-4838

Conversation

@fernandolins
Copy link
Copy Markdown
Contributor

@fernandolins fernandolins commented May 14, 2026

Linked issue

Closes #4838

Summary/motivation

Adds coverage.py-based test coverage for both Python test suites (pylib and qt). Introduces just test-py --coverage and just test-py --coverage --html, plus the just test --coverage.

Coverage reports are written to out/coverage/.

How to test

# Existing behavior unchanged
just test-py

# Terminal summary + enforces thresholds
just test-py --coverage

# Terminal summary + HTML reports under out/coverage/
just test-py --coverage --html

# Umbrella (Python only for now)
just test --coverage
just test --coverage --html

Checklist (minimum)

  • I ran ./ninja check or an equivalent relevant check locally.

Details

  • coverage dependency pinned to >=7.13.5 in pyproject.toml.
  • The coverage umbrella recipe currently delegates to Python only for now

Before / after behavior

Before: no just test-py, no coverage support.
After: just test-py runs Python tests via ninja; just test-py --coverage
runs them with coverage.py and enforces minimum line coverage.

@fernandolins fernandolins force-pushed the feat/python-test-coverage-4838 branch from 0ecf8b6 to a955ec6 Compare May 14, 2026 14:36
@abdnh
Copy link
Copy Markdown
Collaborator

abdnh commented May 14, 2026

I added Windows support. Can you check the changes?

Are we planning to enforce 100% coverage? Do we have a plan on how to tackle Qt?

@fernandolins
Copy link
Copy Markdown
Contributor Author

Thanks @abdnh!

Ideally, we wish to achieve 100% coverage but not in a row.

For the first moment, we want to add a coverage test to ensure which parts of the codebase are tested and which are not. Then, with this information, we'll plan the next steps.

fernandolins and others added 4 commits May 15, 2026 21:28
Add just test-py with --coverage and --html flag support, backed by
coverage.py. Runs pylib and qt test suites separately, writes data to
out/coverage/, and enforces minimum line thresholds (65% pylib, 20% qt).

Closes #4838
Update just test to accept --coverage and --html, delegating to a new
coverage recipe. Currently covers Python only.
@fernandolins fernandolins force-pushed the feat/python-test-coverage-4838 branch from d422c9e to 37186c6 Compare May 16, 2026 00:30
@fernandolins fernandolins merged commit 2ea8e57 into main May 16, 2026
6 checks passed
@fernandolins fernandolins deleted the feat/python-test-coverage-4838 branch May 16, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Python test coverage (coverage.py)

2 participants