test: keep a skipped test out of the failed list #1892

Merged
ChazY11 merged 1 commit from upstream-pr/1899 into main 2026-11-24 20:50:56 +00:00
ChazY11 commented 2026-11-24 20:30:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T20:30:53Z.


What

hardware_reports.markdown() names skipped and failed tests on the one Tests line:

"failed": [name for name, status in report.results.items() if status == "FAIL"],
"skipped": [name for name, status in report.results.items() if status == "SKIP"],
...
tests = f"{item['passed']} passed"
if item["skipped"]: tests += f", skipped: {', '.join(item['skipped'])}"
if item["failed"]:  tests += f", failed: {', '.join(item['failed'])}"

No check asserted that line. Widening either list — if status in ("FAIL", "SKIP") for failed, or the reverse for
skipped — leaves hardware_reports_check.py green, so a report could announce "failed: bvh_wave64" for a test the runner
skipped. Found while reviewing #1829 (which pins the README cell wording but not this summary line).

Change

One unittest case, using the fixture's default of wave64="SKIP" with bvh="FAIL":

body = report(bvh="FAIL")
line = next(t for t in text.splitlines() if "failed:" in t)
before, after = line.split("failed:", 1)
self.assertIn("bvh_wave64", before);      self.assertNotIn("bvh_differential", before)
self.assertIn("bvh_differential", after); self.assertNotIn("bvh_wave64", after)

Splitting on failed: is what pins the separation: a merged list would put both names on one side and fail.

Tested

out/pe-env/Scripts/python.exe -B tests/hardware_reports_check.py
Ran 14 tests ... OK

Negative controls, each reverted:

failed list:  status == "FAIL"  ->  status in ("FAIL", "SKIP")     exit 1
skipped list: status == "SKIP"  ->  status in ("SKIP", "FAIL")     exit 1
reverted                                                           exit 0

The first is the gap I found by mutation; the second guards the mirror case.

Scope

One test file, one case. No production change — tools/hardware_reports.py is untouched.

Notes

  • AI-assisted.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6590816634 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1899). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T20:30:53Z. --- ## What `hardware_reports.markdown()` names skipped and failed tests on the one `Tests` line: ```python "failed": [name for name, status in report.results.items() if status == "FAIL"], "skipped": [name for name, status in report.results.items() if status == "SKIP"], ... tests = f"{item['passed']} passed" if item["skipped"]: tests += f", skipped: {', '.join(item['skipped'])}" if item["failed"]: tests += f", failed: {', '.join(item['failed'])}" ``` No check asserted that line. Widening either list — `if status in ("FAIL", "SKIP")` for `failed`, or the reverse for `skipped` — leaves `hardware_reports_check.py` green, so a report could announce "failed: bvh_wave64" for a test the runner skipped. Found while reviewing #1829 (which pins the README cell wording but not this summary line). ## Change One unittest case, using the fixture's default of `wave64="SKIP"` with `bvh="FAIL"`: ```python body = report(bvh="FAIL") line = next(t for t in text.splitlines() if "failed:" in t) before, after = line.split("failed:", 1) self.assertIn("bvh_wave64", before); self.assertNotIn("bvh_differential", before) self.assertIn("bvh_differential", after); self.assertNotIn("bvh_wave64", after) ``` Splitting on `failed:` is what pins the *separation*: a merged list would put both names on one side and fail. ## Tested ```powershell out/pe-env/Scripts/python.exe -B tests/hardware_reports_check.py Ran 14 tests ... OK ``` Negative controls, each reverted: ```text failed list: status == "FAIL" -> status in ("FAIL", "SKIP") exit 1 skipped list: status == "SKIP" -> status in ("SKIP", "FAIL") exit 1 reverted exit 0 ``` The first is the gap I found by mutation; the second guards the mirror case. ## Scope One test file, one case. No production change — `tools/hardware_reports.py` is untouched. ## Notes - AI-assisted.
upstream-sync closed this pull request 2026-11-24 21:01:13 +00:00
tedin7 commented 2026-11-24 21:01:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:45:10Z.

Review: COMMENTED


Review of head e8718f9f691325923759c72c99e31b0df6da3cd4 (one file, tests/hardware_reports_check.py, +17 lines, test only, no product code touched).

Verdict: no P1/P2 findings. The test is sound and fills a real gap. Nothing else in the suite asserts the Tests: line produced by hardware_reports.markdown (checked with grep), so this is not a duplicate.

Commands run locally (Linux, review venv):

  • git diff --check origin/main...HEAD: clean, exit 0
  • python -B tests/hardware_reports_check.py: Ran 14 tests ... OK
  • python -B tests/bidi_controls_check.py: self-test passed, 1331 files, no bidirectional controls
  • python -B tests/docs_links_check.py: self-test passed, 18 Markdown files, 376 links
  • Neutral title and neutral wording, no external text copied. Windows targets not needed: no Windows code changed.

Mutations on tools/hardware_reports.py (each reverted with git checkout -- ., tree clean afterwards):

  1. failed list also accepts SKIP (line 352): caught. 'bvh_wave64' unexpectedly found in ' bvh_wave64, bvh_differential'.
  2. skipped list takes FAIL instead of SKIP (line 351): caught. 'bvh_wave64' not found in '... skipped: bvh_differential, '.
  3. Label failed: renamed (line 410): caught, but only as a bare StopIteration error from next(...) (see nit 2).

Nits (not blocking):

  • tests/hardware_reports_check.py around line 190: the hunk adds three blank lines after the new test, two more than needed (PEP 8 E303). git diff --check does not flag it. Trim to one blank line.
  • Line 183: next(t for t in ... if "failed:" in t) has no default, so if the label ever changes the failure is an opaque StopIteration instead of the report text. next(..., None) plus an assertIsNotNone(line, text) would print the report.
  • Lines 185 and 187: the test also pins that skipped is printed before failed. That is the current layout, so it is fine, but a harmless reorder of the two clauses would fail it.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6047111336 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1899#pullrequestreview-6047111336). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T20:45:10Z. **Review:** COMMENTED --- Review of head `e8718f9f691325923759c72c99e31b0df6da3cd4` (one file, `tests/hardware_reports_check.py`, +17 lines, test only, no product code touched). **Verdict: no P1/P2 findings. The test is sound and fills a real gap.** Nothing else in the suite asserts the `Tests:` line produced by `hardware_reports.markdown` (checked with grep), so this is not a duplicate. Commands run locally (Linux, review venv): - `git diff --check origin/main...HEAD`: clean, exit 0 - `python -B tests/hardware_reports_check.py`: `Ran 14 tests ... OK` - `python -B tests/bidi_controls_check.py`: self-test passed, 1331 files, no bidirectional controls - `python -B tests/docs_links_check.py`: self-test passed, 18 Markdown files, 376 links - Neutral title and neutral wording, no external text copied. Windows targets not needed: no Windows code changed. Mutations on `tools/hardware_reports.py` (each reverted with `git checkout -- .`, tree clean afterwards): 1. `failed` list also accepts `SKIP` (line 352): caught. `'bvh_wave64' unexpectedly found in ' bvh_wave64, bvh_differential'`. 2. `skipped` list takes `FAIL` instead of `SKIP` (line 351): caught. `'bvh_wave64' not found in '... skipped: bvh_differential, '`. 3. Label `failed:` renamed (line 410): caught, but only as a bare `StopIteration` error from `next(...)` (see nit 2). Nits (not blocking): - `tests/hardware_reports_check.py` around line 190: the hunk adds three blank lines after the new test, two more than needed (PEP 8 E303). `git diff --check` does not flag it. Trim to one blank line. - Line 183: `next(t for t in ... if "failed:" in t)` has no default, so if the label ever changes the failure is an opaque `StopIteration` instead of the report text. `next(..., None)` plus an `assertIsNotNone(line, text)` would print the report. - Lines 185 and 187: the test also pins that skipped is printed before failed. That is the current layout, so it is fine, but a harmless reorder of the two clauses would fail it. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-24 21:01:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:50:04Z.

Review: COMMENTED


Review of head e8718f9f691325923759c72c99e31b0df6da3cd4 (tests/hardware_reports_check.py only, +17 lines, no product code).

Verdict: no P1/P2 findings. Pure-Python fast path (only tests/**/*.py changed), no Windows run needed.

Commands run locally (Linux):

  • git diff --check origin/main...HEAD: rc=0
  • python3 tests/docs_links_check.py: rc=0 (18 files, 376 links)
  • python3 tests/bidi_controls_check.py: rc=0 (1331 files)
  • python3 -m unittest tests.hardware_reports_check: rc=0, Ran 14 tests OK

Mutations on tools/hardware_reports.py (each reverted with git checkout -- ., tree clean):

  1. failed list also accepts SKIP: test fails (rc=1), bvh_wave64 found after "failed:".
  2. skipped list takes FAIL instead of SKIP: test fails (rc=1), bvh_wave64 missing before "failed:".

Nit, not blocking: three blank lines after the new test (PEP 8 E303), one is enough.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6047174148 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1899#pullrequestreview-6047174148). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T20:50:04Z. **Review:** COMMENTED --- Review of head `e8718f9f691325923759c72c99e31b0df6da3cd4` (tests/hardware_reports_check.py only, +17 lines, no product code). Verdict: no P1/P2 findings. Pure-Python fast path (only tests/**/*.py changed), no Windows run needed. Commands run locally (Linux): - git diff --check origin/main...HEAD: rc=0 - python3 tests/docs_links_check.py: rc=0 (18 files, 376 links) - python3 tests/bidi_controls_check.py: rc=0 (1331 files) - python3 -m unittest tests.hardware_reports_check: rc=0, Ran 14 tests OK Mutations on tools/hardware_reports.py (each reverted with git checkout -- ., tree clean): 1. failed list also accepts SKIP: test fails (rc=1), bvh_wave64 found after "failed:". 2. skipped list takes FAIL instead of SKIP: test fails (rc=1), bvh_wave64 missing before "failed:". Nit, not blocking: three blank lines after the new test (PEP 8 E303), one is enough. AI-assisted; commands listed were executed locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1892
No description provided.