fix(ci): build owners of wrappers around selected guest tests #15375

Merged
JJenkx merged 1 commit from upstream-pr/15375 into main 2026-11-04 23:28:38 +00:00
JJenkx commented 2026-11-03 04:06:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-03T04:06:18Z.


What

A Windows job for #14794 selected avplayer_http_patched_modules but failed in AvPlayerHttpModules.cmake:155: its avplayer_http_patched_modules_tests.exe had not been built (failed job). The guest-test runner matched a selected client executable passed to the wrapper and treated that client as the owner. The wrapper itself does not link guest libc, so it was absent from the guest build targets.

Resolve test owners against all executable targets, honor the wrapper's -- <owner> argument, and retain wrappers that reference a selected guest executable. Build their additional owner targets before running CTest. The HTTP wrapper remains selected and its CMake dependencies build with it. No production code or test timeouts change.

Tested

Linux x86-64, Python 3.14.8. Tests use CMake file-API/CTest fixtures with the Windows command shape from the failing job, including its patcher option, owner and guest client arguments. The new regression requires both retaining all three selected CTest cases and building the actual wrapper owner. Additional owner-resolution cases cover Windows .exe paths and extensionless paths.

  • The 25-case guest-runner suite against unmodified main fails the three new regressions; with this change all 25 pass.
  • The 27-case host-only target suite passes.
  • The 49-case selector suite passes with its three existing skips.
  • Conventions and whitespace checks pass.

Commands: python3 -m unittest discover -s tools/tests -p test_build_changed_guest_tests.py, then the same command with test_mingw_host_only_test_targets.py and test_select_tests.py.

Hosted Windows CI on this head completed 3,032 selected CTest cases: 2,073 passed, 959 skipped and zero failed, including avplayer_http_patched_modules in 8.53 s. Its formerly missing wrapper executable was built and the test ran. Hosted relinker jobs also passed on Ubuntu, Windows, macOS arm64 and macOS x86_64, together with relinker ASan (workflow). No title run or separate Windows GPU qualification. This establishes the reproduced missing-build-target selection fix; it does not establish that unrelated failures in other PRs are resolved.

Overlap check fetched 1,756 open PR heads and reported existing base conflicts for #13486 and #15153. Their patches were reviewed manually: #13486's current PR patch does not change these tools; #15153 changes graph-based narrowing, not wrapped-test ownership. #14315's CMake-fragment selection change is separate. This branch depends on none of them; shared files may need rebasing after another lands.

Checklist

  • Based on current main; no other open PR implements the same functions
  • 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:5131718551 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15375). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-03T04:06:18Z. --- ### What A Windows job for #14794 selected `avplayer_http_patched_modules` but failed in `AvPlayerHttpModules.cmake:155`: its `avplayer_http_patched_modules_tests.exe` had not been built ([failed job](https://github.com/boykopovar/AnyPS5/actions/runs/41521585090/job/125543555204)). The guest-test runner matched a selected client executable passed to the wrapper and treated that client as the owner. The wrapper itself does not link guest libc, so it was absent from the guest build targets. Resolve test owners against all executable targets, honor the wrapper's `-- <owner>` argument, and retain wrappers that reference a selected guest executable. Build their additional owner targets before running CTest. The HTTP wrapper remains selected and its CMake dependencies build with it. No production code or test timeouts change. ### Tested Linux x86-64, Python 3.14.8. Tests use CMake file-API/CTest fixtures with the Windows command shape from the failing job, including its patcher option, owner and guest client arguments. The new regression requires both retaining all three selected CTest cases and building the actual wrapper owner. Additional owner-resolution cases cover Windows `.exe` paths and extensionless paths. - The 25-case guest-runner suite against unmodified main fails the three new regressions; with this change all 25 pass. - The 27-case host-only target suite passes. - The 49-case selector suite passes with its three existing skips. - Conventions and whitespace checks pass. Commands: `python3 -m unittest discover -s tools/tests -p test_build_changed_guest_tests.py`, then the same command with `test_mingw_host_only_test_targets.py` and `test_select_tests.py`. Hosted [Windows CI on this head](https://github.com/boykopovar/AnyPS5/actions/runs/41576128751/job/125719966127) completed 3,032 selected CTest cases: 2,073 passed, 959 skipped and zero failed, including `avplayer_http_patched_modules` in 8.53 s. Its formerly missing wrapper executable was built and the test ran. Hosted relinker jobs also passed on Ubuntu, Windows, macOS arm64 and macOS x86_64, together with relinker ASan ([workflow](https://github.com/boykopovar/AnyPS5/actions/runs/41576128751)). No title run or separate Windows GPU qualification. This establishes the reproduced missing-build-target selection fix; it does not establish that unrelated failures in other PRs are resolved. Overlap check fetched 1,756 open PR heads and reported existing base conflicts for #13486 and #15153. Their patches were reviewed manually: #13486's current PR patch does not change these tools; #15153 changes graph-based narrowing, not wrapped-test ownership. #14315's CMake-fragment selection change is separate. This branch depends on none of them; shared files may need rebasing after another lands. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [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
MarcZX10 commented 2026-11-03 04:14:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T04:14:39Z.

Review: COMMENTED


Reviewed — no blocking findings

I reviewed head 69943649b58d9a55f56ab515c109b377843e5a37; the regression coverage and owner-target selection look correct, but I am withholding approval until the pending Windows and macOS jobs finish.

What I ran

Reviewed all changed files at head 69943649b58d9a55f56ab515c109b377843e5a37 against base f6232fcfda70644495273f6b8dd88cf0603463d6. The no-build precheck's current-main merge preview was clean. Environment: Debian Linux x86-64, Python 3.11.2, Git 2.39.5. No local project build or actual CTest run was performed; the Python unit suite uses CMake/CTest fixtures and mocks.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15375
python3 tools/pr_test_quality.py --root /tmp/anyps5-15375-quality --json tools/tests/test_build_changed_guest_tests.py

The precheck inspected the exact head and base and confirmed neither moved during the run. Its optional test-quality invocation could not start because that helper is not present in the isolated PR snapshot. I separately ran the heuristic against the exact changed test file downloaded from the reviewed head; it returned no findings.

Results

Check Result Note
Diff, conventions and Python syntax passed Exact-head checks passed.
Guest-runner unit suite passed 25 tests passed.
Base negative control passed All three new regression assertions failed on base.
Test registration and merge preview passed 251 scripts registered; preview clean.
Test-quality heuristic passed No heuristic findings on the exact changed test.
Hosted policy checks passed Conventions, intake, labels and eligibility passed.
Hosted Linux relinker and ASan passed Exact head.
Hosted Windows and macOS relinker jobs not run Still pending at the final refresh.
Local project build and CTest not run Not needed for this Python tooling change.
Commands and raw check output
$ python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15375
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/report.json
Conclusion: checks failed

$ git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...69943649b58d9a55f56ab515c109b377843e5a37

$ python3 tools/check_conventions.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 69943649b58d9a55f56ab515c109b377843e5a37 --title 'fix(ci): build owners of wrappers around selected guest tests' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/pr-body.md
All conventions checks passed.

$ python3 -m py_compile tools/build_changed_guest_tests.py

$ python3 -m unittest tools.tests.test_build_changed_guest_tests
........python3 -m unittest: Command '['ctest', '--test-dir', '/tmp/tmp4pmh0_lo/build', '--output-on-failure', '--timeout', '120', '--parallel', '4', '--no-tests=error', '-I', '/tmp/anyps5-guest-ctest-hlj7di21/selected-tests.txt']' returned non-zero exit status 2.
.python3 -m unittest: Command 'cmake' returned non-zero exit status 2.
........python3 -m unittest: no ctest registration resolved for: guest_unregistered_tests
........
----------------------------------------------------------------------
Ran 25 tests in 0.174s

OK

$ python3 tools/check_test_registration.py --scripts
251 test script(s), each run by an add_test or a workflow

$ python3 tools/pr_stack_check.py 15375 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/stack
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/stack/stack-report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/stack/stack-report.json

$ python3 tools/pr_test_quality.py --root /tmp/anyps5-15375-quality --json tools/tests/test_build_changed_guest_tests.py
{
  "findings": [],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

$ gh pr checks 15375 --repo boykopovar/AnyPS5
relinker (macos-latest, clang++) pending
relinker (macos-latest, clang++, x86_64) pending
relinker (windows-latest, g++) pending
relinker (ubuntu-latest, g++) pass
register-context skipping
relinker-asan pass
windows pending
edge-watch skipping
linux skipping
write-watch skipping
conventions pass
eligibility pass
intake pass
labels pass

The optional precheck helper invocation returned this raw error; the direct exact-file heuristic run above succeeded:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/head-69943649b58d-01df1715/tools/pr_test_quality.py': [Errno 2] No such file or directory

The precheck's base-revision run produced these raw assertion failures, as expected for the negative control:

FAIL: test_cmake_wrapper_is_not_owned_by_its_guest_client_argument
AssertionError: ['avplayer_http_patched_modules_tests'] not found in [['libs'], ['guest_avplayer_tests', 'guest_http_client_tests']]

FAIL: test_cmake_owner_marker_also_resolves_extensionless_executables
AssertionError: None != 'guest_owner_tests'

FAIL: test_cmake_owner_marker_precedes_tool_options_and_client_arguments
AssertionError: 'nid_patcher' != 'guest_owner_tests'

Negative control

Assertion Change to code under test New test failed on base?
Resolve the wrapper owner after CMake's -- Ran the test module against unmodified base source Yes, assertion failure (nid_patcher was selected).
Resolve an extensionless wrapper owner Ran the test module against unmodified base source Yes, assertion failure (None was returned).
Retain the wrapper and build its owner target Ran the test module against unmodified base source Yes, assertion failure; the wrapper target was absent from build calls.

All three new regressions failed by assertion on base; the 25-case suite passed on the PR head.

Findings

Blocking

None found in the two changed files.

Non-blocking

No additional source changes requested. Approval is pending completion of the hosted Windows and macOS relinker jobs.

Sources

Not verified

The hosted Windows build/CTest and both macOS relinker jobs were pending. Linux and specialized workflow jobs were skipped. I did not run a local build, actual CTest, a Windows/macOS environment, a title run, or console behavior checks.

To get this to a good state

No code change is requested. Let the pending Windows and macOS jobs finish; I will recheck this exact head and update the review if their results change the conclusion.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5747191715 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15375#pullrequestreview-5747191715). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T04:14:39Z. **Review:** COMMENTED --- # Reviewed — no blocking findings I reviewed head `69943649b58d9a55f56ab515c109b377843e5a37`; the regression coverage and owner-target selection look correct, but I am withholding approval until the pending Windows and macOS jobs finish. ## What I ran Reviewed all changed files at head `69943649b58d9a55f56ab515c109b377843e5a37` against base `f6232fcfda70644495273f6b8dd88cf0603463d6`. The no-build precheck's current-main merge preview was clean. Environment: Debian Linux x86-64, Python 3.11.2, Git 2.39.5. No local project build or actual CTest run was performed; the Python unit suite uses CMake/CTest fixtures and mocks. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15375 python3 tools/pr_test_quality.py --root /tmp/anyps5-15375-quality --json tools/tests/test_build_changed_guest_tests.py ``` The precheck inspected the exact head and base and confirmed neither moved during the run. Its optional test-quality invocation could not start because that helper is not present in the isolated PR snapshot. I separately ran the heuristic against the exact changed test file downloaded from the reviewed head; it returned no findings. ## Results | Check | Result | Note | |---|---|---| | Diff, conventions and Python syntax | passed | Exact-head checks passed. | | Guest-runner unit suite | passed | 25 tests passed. | | Base negative control | passed | All three new regression assertions failed on base. | | Test registration and merge preview | passed | 251 scripts registered; preview clean. | | Test-quality heuristic | passed | No heuristic findings on the exact changed test. | | Hosted policy checks | passed | Conventions, intake, labels and eligibility passed. | | Hosted Linux relinker and ASan | passed | Exact head. | | Hosted Windows and macOS relinker jobs | not run | Still pending at the final refresh. | | Local project build and CTest | not run | Not needed for this Python tooling change. | <details><summary>Commands and raw check output</summary> ```text $ python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15375 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/report.json Conclusion: checks failed $ git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...69943649b58d9a55f56ab515c109b377843e5a37 $ python3 tools/check_conventions.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 69943649b58d9a55f56ab515c109b377843e5a37 --title 'fix(ci): build owners of wrappers around selected guest tests' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/pr-body.md All conventions checks passed. $ python3 -m py_compile tools/build_changed_guest_tests.py $ python3 -m unittest tools.tests.test_build_changed_guest_tests ........python3 -m unittest: Command '['ctest', '--test-dir', '/tmp/tmp4pmh0_lo/build', '--output-on-failure', '--timeout', '120', '--parallel', '4', '--no-tests=error', '-I', '/tmp/anyps5-guest-ctest-hlj7di21/selected-tests.txt']' returned non-zero exit status 2. .python3 -m unittest: Command 'cmake' returned non-zero exit status 2. ........python3 -m unittest: no ctest registration resolved for: guest_unregistered_tests ........ ---------------------------------------------------------------------- Ran 25 tests in 0.174s OK $ python3 tools/check_test_registration.py --scripts 251 test script(s), each run by an add_test or a workflow $ python3 tools/pr_stack_check.py 15375 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/stack /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/stack/stack-report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/stack/stack-report.json $ python3 tools/pr_test_quality.py --root /tmp/anyps5-15375-quality --json tools/tests/test_build_changed_guest_tests.py { "findings": [], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } $ gh pr checks 15375 --repo boykopovar/AnyPS5 relinker (macos-latest, clang++) pending relinker (macos-latest, clang++, x86_64) pending relinker (windows-latest, g++) pending relinker (ubuntu-latest, g++) pass register-context skipping relinker-asan pass windows pending edge-watch skipping linux skipping write-watch skipping conventions pass eligibility pass intake pass labels pass ``` The optional precheck helper invocation returned this raw error; the direct exact-file heuristic run above succeeded: ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15375-69943649b58d/head-69943649b58d-01df1715/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` The precheck's base-revision run produced these raw assertion failures, as expected for the negative control: ```text FAIL: test_cmake_wrapper_is_not_owned_by_its_guest_client_argument AssertionError: ['avplayer_http_patched_modules_tests'] not found in [['libs'], ['guest_avplayer_tests', 'guest_http_client_tests']] FAIL: test_cmake_owner_marker_also_resolves_extensionless_executables AssertionError: None != 'guest_owner_tests' FAIL: test_cmake_owner_marker_precedes_tool_options_and_client_arguments AssertionError: 'nid_patcher' != 'guest_owner_tests' ``` </details> ## Negative control | Assertion | Change to code under test | New test failed on base? | |---|---|---| | Resolve the wrapper owner after CMake's `--` | Ran the test module against unmodified base source | Yes, assertion failure (`nid_patcher` was selected). | | Resolve an extensionless wrapper owner | Ran the test module against unmodified base source | Yes, assertion failure (`None` was returned). | | Retain the wrapper and build its owner target | Ran the test module against unmodified base source | Yes, assertion failure; the wrapper target was absent from build calls. | All three new regressions failed by assertion on base; the 25-case suite passed on the PR head. ## Findings ### Blocking None found in the two changed files. ### Non-blocking No additional source changes requested. Approval is pending completion of the hosted Windows and macOS relinker jobs. ## Sources - [Owner resolution and wrapper target selection at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/69943649b58d9a55f56ab515c109b377843e5a37/tools/build_changed_guest_tests.py#L87-L137) - [New owner-resolution regressions at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/69943649b58d9a55f56ab515c109b377843e5a37/tools/tests/test_build_changed_guest_tests.py#L112-L124) - [Wrapper retention and additional-owner build regression at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/69943649b58d9a55f56ab515c109b377843e5a37/tools/tests/test_build_changed_guest_tests.py#L206-L235) - [Original owner-resolution behavior at the base](https://github.com/boykopovar/AnyPS5/blob/f6232fcfda70644495273f6b8dd88cf0603463d6/tools/build_changed_guest_tests.py#L87-L101) ## Not verified The hosted Windows build/CTest and both macOS relinker jobs were pending. Linux and specialized workflow jobs were skipped. I did not run a local build, actual CTest, a Windows/macOS environment, a title run, or console behavior checks. ## To get this to a good state No code change is requested. Let the pending Windows and macOS jobs finish; I will recheck this exact head and update the review if their results change the conclusion.
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!15375
No description provided.