Repository navigation
test(hardware): isolate failing probe coverage - #397
itsskofficial merged 2 commits into
Conversation
Signed-off-by: fukalous <fukalous@gmail.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
|
@fukalous, sorry for the long silence on this one; it's on us. Your PRs were waiting for a maintainer to approve CI (GitHub holds it on a contributor's first PRs), and we missed it for almost two weeks. I've approved the runs now. We'll also merge |
No conflicts; brings the branch up to date so CI runs against current main.
|
@fukalous, I've merged |
itsskofficial
left a comment
There was a problem hiding this comment.
Thanks @fukalous, this is a clean fix for a real isolation bug, and sorry it waited so long.
What I ran on this Windows 11 machine, at the merge commit a8c4800a:
pytest tests/test_hardware_context.py: 39 passed.test_detect_never_fails_when_every_probe_doesnow runs as[win32],[linux]and[darwin], and all three pass.- The Apple Silicon case, simulated. I don't have an Apple Silicon Mac, so I couldn't run it on real hardware. Instead I ran the test inside a wrapper that makes the host look like an arm64 Mac:
sys.platform="darwin",platform.machine()="arm64", andsysctlanswering "Apple M5 Pro". Withmain's version of the test it fails exactly as #396 describes:Left contains one more item: {'name': 'Apple M5 Pro', 'vendor': 'apple', 'vram_gb': None, 'usable': True}. With your version it passes, because the test now pinssys.platformandplatform.machine()itself. - The arm64 path is still covered by
test_apple_silicon_counts_two_thirds_of_memory, as the PR says.
No review threads. CI on a8c4800a is green. No changelog entry needed for a test-only change.
What and why
Make the all-probes-fail hardware test independent of the machine running pytest. The test now exercises fixed Windows, Linux, and Intel macOS branches while every platform probe raises; the existing Apple Silicon test continues to own the arm64-specific detection path.
This prevents a real Apple GPU from leaking into the supposedly fully mocked test on Apple Silicon hosts.
Closes #396
How I tested it
main@0fda9553:test_detect_never_fails_when_every_probe_doesfails on macOS arm64 becausedetect()appends the hostApple M5 Pro.pytest -q tests/test_hardware_context.py(39 passed)pytest -q(2277 passed, 3 skipped)ruff check sentient testsgit diff --checkAI assistance
I used an AI coding assistant to investigate and prepare the change. I reviewed the final diff and ran the checks above locally.
Checklist
pytest/npm run typecheckpass locally for what I touchedruff check sentient testsis cleandocs/API.mddoes not need an updateSummary by CodeRabbit