ci(build): select Windows pull request tests from the test graph of main #15153
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15153"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by starlord-93 on 2026-11-02T18:58:31Z.
What
The Windows pull request job restores
test-graph.json(the graph that push builds of main save) on pull requests, not only forselectruns.tools/build_mingw_host_only_tests.pyandtools/build_changed_guest_tests.pytake--graph: a changedcore/libsheader or libraryCMakeLists.txtselects only the tests whose graph scope includes it (select_tests.select), plus tests whose own sources changed.Every test is still selected when the graph is missing or invalid, when a changed header is not in the graph, when
select_tests.pytreats a path as build-wide (core/libs/CMakeLists.txt,cmake/,3rdparty/and the others inFULL), and when the rootCMakeLists.txt,build.yml, either script orselect_tests.pychanges.select_tests.pyis added to both scripts' build-wide sets because the selection now depends on it. The job timeout, push builds and production-source-only changes are unchanged.Conflicts with #12159, #14315, #14317 and #14414 in the build-wide blocks of the two scripts; each of them merges cleanly with main. If one merges first, I rebase this.
Tested
Linux, Python 3.13:
python3 -m unittest tools/tests/test_build_changed_guest_tests.py tools/tests/test_mingw_host_only_test_targets.py tools/tests/test_select_tests.pypasses (106 tests, 3 skipped), including 12 new tests for graph narrowing, the fallbacks, case-insensitive executable matching and the workflow steps. The fulltools/testssuite has the same 3 failures on main and on this branch (test_patch_lib_atrac9x2,test_run_report_schemapinned validator). Not tested on a Windows runner: this pull request's own Windows job selects every test because it changesbuild.ymland the scripts.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T19:10:44Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The PR can restore a valid test graph from an older
maincommit and use it to omit tests added since that graph was generated.What I ran
Reviewed all five changed files at head
ce73562ac71a11c13879e78bf6fa43a10af9f82c, against PR basea4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8. The head merges cleanly against that currentmainpreview. Environment: Debian 12, Linux 6.1, Python 3.11.2, Git 2.39.5; no compiler or build was run.The focused Python tests ran against the exact PR head. The precheck ran syntax, registration and two related unit-test suites as well.
Results
Commands and unedited outputs
Focused Python suite:
Conventions output from the precheck:
The precheck's optional helpers were absent from its isolated PR checkout:
The same precheck's base-source negative-control attempt could not run the new tests against the old helper signature:
Synthetic stale-graph probe (run from the repository root):
Overlap helper output:
Hosted status snapshot:
Negative control
mainbase is required before narrowing the current test set.Findings
Blocking
The Windows job restores by the exact base-SHA cache key and also supplies the prefix fallback
test-graph-Windows-. If the exact cache is missing, the fallback can provide a graph generated by an earliermain.select_tests.load_graphvalidates the JSON shape but records or checks no source commit. The new selector then accepts that graph whenever the changed header is present in its old closures. A test target added to currentmainafter graph generation is absent from those closures and can be skipped. I reproduced the selection using a valid old graph: the current target set containedold_targetandnew_target, but the selector chose onlyold_target; with no graph it chose both.Remove prefix-cache fallback for PR test selection so a missing exact graph triggers the existing full-selection fallback, or store and verify the graph's source SHA against the current base SHA. Add a regression test for a valid but stale graph.
Non-blocking
Sources
Not verified
main.pr_overlap.pycould not complete its repository-wide scan.To get this to a good state
Bind the graph to the exact
mainSHA or use only the exact cache key for PR selection, and test that an older valid graph falls back to all current targets. I will rerun the same precheck and focused Python suite on the updated head.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-07T00:32:44Z.
Review: CHANGES_REQUESTED
Thanks for this. Two things block it:
test-graph.jsonsaved by an oldermaincommit. A test whose executable was added after that commit is not in the graph, so a header change that should build it selects nothing for it and the job passes without linking it. Either restore only the exact base-SHA key on pull requests, or keep the prefix fallback and also feed the scripts the paths changed between the graph's commit (taken fromcache-matched-key) and the PR head, so those tests are selected too. Falling back to every test when the graph does not match the current base is also fine. Please add a test where the graph lacks a currently configured executable (the host-only and guest scripts both need one). Ducengarth and veosett posted concrete patches for either option.mainmoved: #12159 merged and touches the same build-wide blocks intools/build_mingw_host_only_tests.py, so this now conflicts. Please rebase and keep its transitive-dependency selection working with--graph.Once those are in, the change itself (graph narrowing with the fallbacks) looks right to me.
Pull request closed