fix(ci): run every guest test when a CMake fragment under core/libs changes #14315

Closed
MarcZX10 wants to merge 0 commits from upstream-pr/14315 into main
MarcZX10 commented 2026-11-01 09:47:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:47:39Z.


What

tools/build_changed_guest_tests.py decides which guest tests a pull request runs on the Windows path. A change to a header, or to a CMakeLists.txt, under core/libs/ selects every guest test. A change to a .cmake fragment under core/libs/, for example core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_flip_tests.cmake, matches neither rule and is not the source of any target. The selection is therefore empty, although those fragments define guest tests and their add_test calls. A pull request that changes only such a fragment runs no guest test.

The fix adds .cmake to the suffixes that count as a broad change, so a fragment change selects every guest test, as a header change does. It is in two commits:

  • 7b9094a8c7: the broad-change suffixes in tools/build_changed_guest_tests.py.
  • f7cb408e0e: test_a_cmake_fragment_change_selects_every_guest_test in tools/tests/test_build_changed_guest_tests.py.
  • e4cbe53c36: merges current main (26fa1212b8) into the branch so the macOS x86_64 relinker job uses the Rosetta guard from #14332. No other change.

Cost: every .cmake change under core/libs/ now runs every guest test on the Windows path, as a header change already does. The narrower option, mapping a fragment to the targets whose ctest backtrace names it, is not implemented here.

Tested

Linux, Python 3.11.2, on upstream/main 5c9837bfe7 plus these commits. No build was run; this module tests selection logic against fixture targets.

  • python3 tools/tests/test_build_changed_guest_tests.py: 20 tests, OK.
  • Negative control: GuestTestTargets.test_a_cmake_fragment_change_selects_every_guest_test run against upstream/main's tools/build_changed_guest_tests.py fails with [] != ['guest_a_tests', 'guest_b_tests'].
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main: clean.

Not run: the Windows workflow on GitHub, and the guest tests the selection would run.

Checklist

  • Based on current main
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5105847817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14315). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T09:47:39Z. --- ### What `tools/build_changed_guest_tests.py` decides which guest tests a pull request runs on the Windows path. A change to a header, or to a `CMakeLists.txt`, under `core/libs/` selects every guest test. A change to a `.cmake` fragment under `core/libs/`, for example `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_flip_tests.cmake`, matches neither rule and is not the source of any target. The selection is therefore empty, although those fragments define guest tests and their `add_test` calls. A pull request that changes only such a fragment runs no guest test. The fix adds `.cmake` to the suffixes that count as a broad change, so a fragment change selects every guest test, as a header change does. It is in two commits: - `7b9094a8c7`: the broad-change suffixes in `tools/build_changed_guest_tests.py`. - `f7cb408e0e`: `test_a_cmake_fragment_change_selects_every_guest_test` in `tools/tests/test_build_changed_guest_tests.py`. - `e4cbe53c36`: merges current `main` (`26fa1212b8`) into the branch so the macOS x86_64 relinker job uses the Rosetta guard from #14332. No other change. Cost: every `.cmake` change under `core/libs/` now runs every guest test on the Windows path, as a header change already does. The narrower option, mapping a fragment to the targets whose `ctest` backtrace names it, is not implemented here. ### Tested Linux, Python 3.11.2, on `upstream/main` `5c9837bfe7` plus these commits. No build was run; this module tests selection logic against fixture targets. - `python3 tools/tests/test_build_changed_guest_tests.py`: 20 tests, OK. - Negative control: `GuestTestTargets.test_a_cmake_fragment_change_selects_every_guest_test` run against `upstream/main`'s `tools/build_changed_guest_tests.py` fails with `[] != ['guest_a_tests', 'guest_b_tests']`. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main`: clean. Not run: the Windows workflow on GitHub, and the guest tests the selection would run. ### Checklist - [x] Based on current `main` - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-02 01:20:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:20:34Z.

Review: APPROVED


Windows 11, Python 3.14.7. Head e4cbe53c36 merged into upstream/main 93dbd0f82a:

  • tools/tests/test_build_changed_guest_tests.py: 20 tests OK (1 skipped).
  • Negative control: with main's tools/build_changed_guest_tests.py, test_a_cmake_fragment_change_selects_every_guest_test fails.

Treating a .cmake fragment under core/libs/ as a broad change, like a header, is the conservative choice, given that the AGC fragments hold both executable and add_test definitions.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731206159 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14315#pullrequestreview-5731206159). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T01:20:34Z. **Review:** APPROVED --- Windows 11, Python 3.14.7. Head e4cbe53c36 merged into upstream/main 93dbd0f82a: - `tools/tests/test_build_changed_guest_tests.py`: 20 tests OK (1 skipped). - Negative control: with main's `tools/build_changed_guest_tests.py`, `test_a_cmake_fragment_change_selects_every_guest_test` fails. Treating a `.cmake` fragment under `core/libs/` as a broad change, like a header, is the conservative choice, given that the AGC fragments hold both executable and `add_test` definitions.
MarcZX10 commented 2026-11-02 06:24:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T06:24:11Z.

Review: COMMENTED


Reviewed — no blocking findings

A change to a .cmake fragment under core/libs/ now selects every guest test to build, the same as a change to a header or a CMakeLists.txt already does. The one-line change and its new test are right as far as they go. The hosted ubuntu CTest run passed build_changed_guest_tests.

What I ran

  • Head e4cbe53c36a9c54ba531f7b9ac098dfadcb91698; base 26fa1212b82f76dd49cf12d65e445d6ff3e0844c. 2 files: tools/build_changed_guest_tests.py (adds .cmake to the extensions that make a core/libs/ change broad) and tools/tests/test_build_changed_guest_tests.py (+6: one new test with a fragment path under core/libs/prx/libSceAgcDriver/tests/cmake/).
  • Read both diffs in full. The rule the change extends is the broad_change test on line 48.
  • Hosted: the ubuntu relinker job's CTest run for this head (550 of 550 passed) ran build_changed_guest_tests (Test #8, passed, 0.24 s).
  • Read-only checks from the trusted main checkout: diff check, conventions and PR template, and the stack check all passed. The ABI audit is not applicable. The Python tests were not run here, because the PR changes .py files.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed stack check passed; no declared dependencies
.cmake under core/libs/ makes the change broad passed by reading one extension added to the existing tuple
The new test (test_a_cmake_fragment_change_selects_every_guest_test) passed (hosted) run inside build_changed_guest_tests on the ubuntu CTest run
Other .cmake paths outside core/libs/ passed by reading the condition still requires the core/libs/ prefix
ABI audit not applicable no export changed
Build and runtime tests (Linux) run hosted see above
Negative controls not run no local build
Hosted CI passed conventions, eligibility, labels, relinkers and relinker-asan succeeded; windows skipped
Read-only check output

Precheck was not run: no PR-head code is run here, and the PR changes .py files. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed. Hosted: gh api repos/boykopovar/AnyPS5/commits/e4cbe53c36a9c54ba531f7b9ac098dfadcb91698/check-runs, and the ubuntu relinker job log.

Negative control

Not run here. A negative control needs a local run of the Python tests, and the PR's Python code is not run here.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

  • The Windows job's selection for this change (the Windows job is skipped on this head).

To get this to a good state

  • Nothing to change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732785822 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14315#pullrequestreview-5732785822). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T06:24:11Z. **Review:** COMMENTED --- # Reviewed — no blocking findings A change to a `.cmake` fragment under `core/libs/` now selects every guest test to build, the same as a change to a header or a `CMakeLists.txt` already does. The one-line change and its new test are right as far as they go. The hosted ubuntu CTest run passed `build_changed_guest_tests`. ## What I ran - Head `e4cbe53c36a9c54ba531f7b9ac098dfadcb91698`; base `26fa1212b82f76dd49cf12d65e445d6ff3e0844c`. 2 files: `tools/build_changed_guest_tests.py` (adds `.cmake` to the extensions that make a `core/libs/` change broad) and `tools/tests/test_build_changed_guest_tests.py` (+6: one new test with a fragment path under `core/libs/prx/libSceAgcDriver/tests/cmake/`). - Read both diffs in full. The rule the change extends is the `broad_change` test on line 48. - Hosted: the ubuntu relinker job's CTest run for this head (550 of 550 passed) ran `build_changed_guest_tests` (`Test #8`, passed, 0.24 s). - Read-only checks from the trusted main checkout: diff check, conventions and PR template, and the stack check all passed. The ABI audit is not applicable. The Python tests were not run here, because the PR changes `.py` files. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | conventions check from the main checkout | | Mergeability and dependencies | passed | stack check passed; no declared dependencies | | `.cmake` under `core/libs/` makes the change broad | passed by reading | one extension added to the existing tuple | | The new test (`test_a_cmake_fragment_change_selects_every_guest_test`) | passed (hosted) | run inside `build_changed_guest_tests` on the ubuntu CTest run | | Other `.cmake` paths outside `core/libs/` | passed by reading | the condition still requires the `core/libs/` prefix | | ABI audit | not applicable | no export changed | | Build and runtime tests (Linux) | run hosted | see above | | Negative controls | not run | no local build | | Hosted CI | passed | conventions, eligibility, labels, relinkers and relinker-asan succeeded; windows skipped | <details><summary>Read-only check output</summary> Precheck was not run: no PR-head code is run here, and the PR changes `.py` files. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed. Hosted: `gh api repos/boykopovar/AnyPS5/commits/e4cbe53c36a9c54ba531f7b9ac098dfadcb91698/check-runs`, and the ubuntu relinker job log. </details> ## Negative control Not run here. A negative control needs a local run of the Python tests, and the PR's Python code is not run here. ## Findings **Blocking** None. **Non-blocking** None. ## Sources - Production: https://github.com/boykopovar/AnyPS5/blob/e4cbe53c36a9c54ba531f7b9ac098dfadcb91698/tools/build_changed_guest_tests.py - Test: https://github.com/boykopovar/AnyPS5/blob/e4cbe53c36a9c54ba531f7b9ac098dfadcb91698/tools/tests/test_build_changed_guest_tests.py - Hosted log: ubuntu relinker job for e4cbe53c36 (CTest 550 of 550) ## Not verified - The Windows job's selection for this change (the Windows job is skipped on this head). ## To get this to a good state - Nothing to change.

Pull request closed

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
boykopovar/AnyPS5!14315
No description provided.