tests: run repeated CLI checks in-process in resource_ranges_check #1576

Merged
tedin7 merged 2 commits from upstream-pr/1583 into main 2026-11-24 15:07:28 +00:00
tedin7 commented 2026-11-24 14:35:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T14:35:48Z.


Summary

  • Extract main(argv=None) entrypoints in tools/texture_descriptors.py and tools/section_probe.py while preserving identical CLI parsing, stdout/stderr, and exit codes.
  • Replace 20 repeated subprocess.run calls in tests/resource_ranges_check.py with an in-process run_cli() helper capturing stdout, stderr, and SystemExit return codes.
  • Keep one end-to-end subprocess.run smoke test per tool (test_texture_descriptor_inventory for tools/texture_descriptors.py and the passing case in test_section_probe_cli_validates_tags for tools/section_probe.py).

Verification

  • python3 -B tests/resource_ranges_check.py: 20 tests pass (Ran 20 tests in 0.287s).
  • Linux 3-run median: 2.601s -> 0.394s (6.6x faster, -84.9%).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6584216001 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1583). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T14:35:48Z. --- ## Summary - Extract `main(argv=None)` entrypoints in `tools/texture_descriptors.py` and `tools/section_probe.py` while preserving identical CLI parsing, stdout/stderr, and exit codes. - Replace 20 repeated `subprocess.run` calls in `tests/resource_ranges_check.py` with an in-process `run_cli()` helper capturing `stdout`, `stderr`, and `SystemExit` return codes. - Keep one end-to-end `subprocess.run` smoke test per tool (`test_texture_descriptor_inventory` for `tools/texture_descriptors.py` and the passing case in `test_section_probe_cli_validates_tags` for `tools/section_probe.py`). ## Verification - `python3 -B tests/resource_ranges_check.py`: 20 tests pass (`Ran 20 tests in 0.287s`). - Linux 3-run median: `2.601s` -> `0.394s` (`6.6x` faster, `-84.9%`). AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 15:02:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:47:18Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:50:06.926597Z dadee3b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7134947715 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1583#issuecomment-7134947715). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T14:47:18Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"dadee3b6c692a3576e9d8e16a8cd47be11634cd2","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T14:50:06.926597Z">2026-11-24T14:50:06.926597Z</relative-time> | `dadee3b` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
R0Y00 commented 2026-11-24 15:02:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T15:01:21Z.


At 0be4f8a7, both section_probe.py and texture_descriptors.py keep one end-to-end subprocess check. The repeated cases still run in-process. All 20 resource_ranges_check.py cases passed on Windows.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7135329774 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1583#issuecomment-7135329774). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T15:01:21Z. --- At 0be4f8a7, both section_probe.py and texture_descriptors.py keep one end-to-end subprocess check. The repeated cases still run in-process. All 20 resource_ranges_check.py cases passed on Windows.
upstream-sync closed this pull request 2026-11-24 16:03:09 +00:00
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!1576
No description provided.