ci(build): write ctest.log on the Windows pull request path so tests over 30 s are reported #14414

Merged
roboterspinne merged 1 commit from upstream-pr/14414 into main 2026-11-02 22:35:54 +00:00
roboterspinne commented 2026-11-01 11:52:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by roboterspinne on 2026-11-01T11:52:19Z.


What

CONTRIBUTING.md:19 says "CI reports every test over 30 s as a warning on the pull request". The Windows job's Report tests slower than 30 s step (.github/workflows/build.yml:731-737 on 26fa1212b8) runs on pull requests too (if: ${{ !cancelled() }}), but it starts with [ -f ctest.log ] || exit 0, and on pull requests nothing writes ctest.log: only the push path does (tools/select_tests.py ctest ... --output-log ctest.log, build.yml:717). On pull requests the tests run through tools/build_changed_guest_tests.py (build.yml:710), whose only test run is a ctest call without --output-log (tools/build_changed_guest_tests.py:123-124), so the step finds no log and exits 0. The step came with bc02b80c18 (8 Oct) and the guest pull request path later with aebcf0452a (29 Oct), whose message does not mention the report. Windows pull request jobs therefore never warn: job 124799687344 ran agc_shader_disk_cache_large_file in 58.13 s, and jobs 124800279901, 124799727392 and 124798085892 ran tests in 50.33 s, 46.69 s and 30.37 s, all without a ##[warning], while the Windows push runs of main do warn. The Linux job already writes the log on pull requests (build.yml:544) and runs the same awk (build.yml:562-568).

  • Rule. build_changed_guest_tests.py takes an optional --output-log PATH and appends --output-log PATH to its single ctest run; the Windows pull request step passes --output-log ctest.log. CTest resolves the path against the caller's working directory, the workspace root where the report step reads it, as on the push path. Without the option the ctest command is unchanged, and the awk is not touched. Expected consequence: agc_shader_disk_cache_large_file (TIMEOUT 240; over 30 s in 4 of 25 recent Windows runs at 30.4-58.1 s, 14.0-29.8 s in the other 21) can warn on pull requests whose guest test selection includes it.
  • Tests. test_output_log_reaches_the_ctest_run calls main() with --output-log ctest.log and subprocess.run mocked, and asserts that exactly one ctest call carries -I and that it passes --output-log ctest.log. The existing tests call main() and run() without the option and still pass.
  • Overlap. pr_overlap.py --branch compared all 1653 open pull requests against main and reports no shared lines with any of them; none was left uncompared. My pull request "fix(tools): end the CTest index file with a newline so the Windows pull request job runs the last selected guest test" changes tools/build_changed_guest_tests.py and its tests in other lines; a trial merge of the two branches is clean.

Tested

Windows 11, WinLibs GCC 15.2.0 (CTest 4.3.1 from the same WinLibs package), Python 3.13.9; synthetic CTest files only, no title or homebrew. No C++ build is needed.

  • python tools/tests/test_build_changed_guest_tests.py -v (registered as the build_changed_guest_tests CTest test, CMakeLists.txt:196): Ran 20 tests in 2.041s, OK (skipped=1) (the symbolic link test skips without the Windows symlink privilege, as on main).
  • Counter-check: the new test against the untouched tools/build_changed_guest_tests.py of 26fa1212b8 fails with error: unrecognized arguments: --output-log ctest.log; with the change it passes.
  • End to end with real ctest: run() with only the cmake --build calls stubbed, against a CTestTestfile.cmake whose selected test sleeps 31 s, then the step's shell lines from build.yml:735-737 with RUNNER_OS=Windows in the same directory. On 26fa1212b8: Passed 31.21 sec, no ctest.log, the step exits 0. With this change: Passed 31.74 sec, ctest.log in the working directory, and the step prints ::warning title=Slow test::slow_guest_case took 31.7 s on Windows; tests must finish in 30 s (CONTRIBUTING.md).
  • .github/workflows/build.yml parses with PyYAML; the changed step reads python tools/build_changed_guest_tests.py build changed.txt --output-log ctest.log.
  • python tools/check_conventions.py --base 26fa1212b8 --head HEAD with this title and description passed.
  • The workflow change itself runs only on GitHub. build.yml is in BROAD_CHANGES (tools/build_changed_guest_tests.py:15), so this pull request's Windows job selects every guest test, and a selected test that takes over 30 s there produces the ::warning; agc_shader_disk_cache_large_file did so in only 4 of 25 recent Windows runs, so this pull request's own run may show no warning.
  • The workflow tests that read build.yml check other steps: python tools/tests/test_mingw_host_only_test_targets.py (Ran 17 tests, OK) reads the mingwHostTests gate, and test_build_eligibility.py reads the gate script and skips here without node.

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 (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5107063795 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14414). Originally posted by [roboterspinne](https://github.com/roboterspinne) on 2026-11-01T11:52:19Z. --- ### What `CONTRIBUTING.md:19` says "CI reports every test over 30 s as a warning on the pull request". The Windows job's `Report tests slower than 30 s` step (`.github/workflows/build.yml:731-737` on 26fa1212b8) runs on pull requests too (`if: ${{ !cancelled() }}`), but it starts with `[ -f ctest.log ] || exit 0`, and on pull requests nothing writes `ctest.log`: only the push path does (`tools/select_tests.py ctest ... --output-log ctest.log`, `build.yml:717`). On pull requests the tests run through `tools/build_changed_guest_tests.py` (`build.yml:710`), whose only test run is a `ctest` call without `--output-log` (`tools/build_changed_guest_tests.py:123-124`), so the step finds no log and exits 0. The step came with bc02b80c18 (8 Oct) and the guest pull request path later with aebcf0452a (29 Oct), whose message does not mention the report. Windows pull request jobs therefore never warn: job 124799687344 ran `agc_shader_disk_cache_large_file` in 58.13 s, and jobs 124800279901, 124799727392 and 124798085892 ran tests in 50.33 s, 46.69 s and 30.37 s, all without a `##[warning]`, while the Windows push runs of `main` do warn. The Linux job already writes the log on pull requests (`build.yml:544`) and runs the same `awk` (`build.yml:562-568`). - **Rule.** `build_changed_guest_tests.py` takes an optional `--output-log PATH` and appends `--output-log PATH` to its single `ctest` run; the Windows pull request step passes `--output-log ctest.log`. CTest resolves the path against the caller's working directory, the workspace root where the report step reads it, as on the push path. Without the option the `ctest` command is unchanged, and the `awk` is not touched. Expected consequence: `agc_shader_disk_cache_large_file` (`TIMEOUT 240`; over 30 s in 4 of 25 recent Windows runs at 30.4-58.1 s, 14.0-29.8 s in the other 21) can warn on pull requests whose guest test selection includes it. - **Tests.** `test_output_log_reaches_the_ctest_run` calls `main()` with `--output-log ctest.log` and `subprocess.run` mocked, and asserts that exactly one `ctest` call carries `-I` and that it passes `--output-log ctest.log`. The existing tests call `main()` and `run()` without the option and still pass. - **Overlap.** `pr_overlap.py --branch` compared all 1653 open pull requests against `main` and reports no shared lines with any of them; none was left uncompared. My pull request "fix(tools): end the CTest index file with a newline so the Windows pull request job runs the last selected guest test" changes `tools/build_changed_guest_tests.py` and its tests in other lines; a trial merge of the two branches is clean. ### Tested <!-- 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. --> Windows 11, WinLibs GCC 15.2.0 (CTest 4.3.1 from the same WinLibs package), Python 3.13.9; synthetic CTest files only, no title or homebrew. No C++ build is needed. - `python tools/tests/test_build_changed_guest_tests.py -v` (registered as the `build_changed_guest_tests` CTest test, `CMakeLists.txt:196`): `Ran 20 tests in 2.041s`, `OK (skipped=1)` (the symbolic link test skips without the Windows symlink privilege, as on `main`). - Counter-check: the new test against the untouched `tools/build_changed_guest_tests.py` of 26fa1212b8 fails with `error: unrecognized arguments: --output-log ctest.log`; with the change it passes. - End to end with real `ctest`: `run()` with only the `cmake --build` calls stubbed, against a `CTestTestfile.cmake` whose selected test sleeps 31 s, then the step's shell lines from `build.yml:735-737` with `RUNNER_OS=Windows` in the same directory. On 26fa1212b8: `Passed 31.21 sec`, no `ctest.log`, the step exits 0. With this change: `Passed 31.74 sec`, `ctest.log` in the working directory, and the step prints `::warning title=Slow test::slow_guest_case took 31.7 s on Windows; tests must finish in 30 s (CONTRIBUTING.md)`. - `.github/workflows/build.yml` parses with PyYAML; the changed step reads `python tools/build_changed_guest_tests.py build changed.txt --output-log ctest.log`. - `python tools/check_conventions.py --base 26fa1212b8 --head HEAD` with this title and description passed. - The workflow change itself runs only on GitHub. `build.yml` is in `BROAD_CHANGES` (`tools/build_changed_guest_tests.py:15`), so this pull request's Windows job selects every guest test, and a selected test that takes over 30 s there produces the `::warning`; `agc_shader_disk_cache_large_file` did so in only 4 of 25 recent Windows runs, so this pull request's own run may show no warning. - The workflow tests that read `build.yml` check other steps: `python tools/tests/test_mingw_host_only_test_targets.py` (`Ran 17 tests`, `OK`) reads the `mingwHostTests` gate, and `test_build_eligibility.py` reads the `gate` script and skips here without `node`. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes (Claude Code)
MarcZX10 commented 2026-11-01 13:44:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T13:44:03Z.

Review: COMMENTED


Reviewed — no blocking findings

The Windows pull-request path now writes ctest.log, so the existing 30-second report step has a log to read; the change is limited to passing one option and does not touch the push path.

What I ran

  • Exact head 917984c07d350c043692a41d9f29ffc718f79c6a, base ba627802e2210187d417deb64c8f2fed8e33011f.
  • Environment: Linux, /usr/bin/python3 3.11.2, no build.
  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14414 --output-dir /dev/shm/reviewer-run/precheck/14414
  • Test-quality helper by hand on the head extract of the changed test:
    python3 tools/pr_test_quality.py --root /dev/shm/reviewer-run/src2/14414 --json tools/tests/test_build_changed_guest_tests.py (0 findings)
  • Workflow read at head with gh api (build.yml lines 710, 717, 735).

Results

Precheck report, checks table, unedited (/dev/shm/reviewer-run/precheck/14414/report.md):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...917984c07d350c043692a41d9f29ffc718f79c6a
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 917984c07d350c043692a41d9f29ffc718f79c6a --title ci(build): write ctest.log on the Windows pull request path so tests over 30 s are reported --body /dev/shm/reviewer-run/precheck/14414/pr-body.md
changed_export_abi_audit not_applicable No changed source or public header under core/libs/prx.
python_syntax passed /usr/bin/python3 -m py_compile tools/build_changed_guest_tests.py
unit:tools/tests/test_build_changed_guest_tests.py passed /usr/bin/python3 -m unittest tools.tests.test_build_changed_guest_tests
python_test_registration passed /usr/bin/python3 tools/check_test_registration.py --scripts
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14414 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14414/stack
build_dependent_cpp_tests not_applicable No C/C++ implementation or test files changed.
test_quality_heuristics failed /usr/bin/python3 /dev/shm/reviewer-run/precheck/14414/head-917984c07d35-e64ce192/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14414/head-917984c07d35-e64ce192 --json .github/workflows/build.yml tools/build_changed_guest_tests.py tools/tests/test_build_changed_guest_tests.py
negative_controls failed A pass means every candidate failed by assertion on base; a failure means at least one did not discriminate or could not run. See per-test results.

Negative control

The new test_output_log_reaches_the_ctest_run fails on base with unrecognized arguments: --output-log ctest.log (argparse exit 2), so it discriminates the change. The precheck classified it not_executable because the failure is an argparse exit, not an assertion; that is a label issue, not a weak test.

Findings

Blocking: none.

Non-blocking:

  • The new --output-log is passed only on the pull-request step; the report step's [ -f ctest.log ] || exit 0 now finds the file on PR runs, as the PR describes.

Sources

Not verified

  • The Windows warning behaviour on a PR run (the PR's job-level evidence is author-reported) was not reproduced.
  • ctest --output-log on the Windows runner was not run here.
  • Hosted: windows and relinker ubuntu/windows/asan passed; macOS clang jobs were queued at review time.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5728345773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14414#pullrequestreview-5728345773). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T13:44:03Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The Windows pull-request path now writes `ctest.log`, so the existing 30-second report step has a log to read; the change is limited to passing one option and does not touch the push path. ## What I ran - Exact head `917984c07d350c043692a41d9f29ffc718f79c6a`, base `ba627802e2210187d417deb64c8f2fed8e33011f`. - Environment: Linux, `/usr/bin/python3` 3.11.2, no build. - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14414 --output-dir /dev/shm/reviewer-run/precheck/14414` - Test-quality helper by hand on the head extract of the changed test: `python3 tools/pr_test_quality.py --root /dev/shm/reviewer-run/src2/14414 --json tools/tests/test_build_changed_guest_tests.py` (0 findings) - Workflow read at head with `gh api` (`build.yml` lines 710, 717, 735). ## Results Precheck report, checks table, unedited (`/dev/shm/reviewer-run/precheck/14414/report.md`): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...917984c07d350c043692a41d9f29ffc718f79c6a` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 917984c07d350c043692a41d9f29ffc718f79c6a --title ci(build): write ctest.log on the Windows pull request path so tests over 30 s are reported --body /dev/shm/reviewer-run/precheck/14414/pr-body.md` | | changed_export_abi_audit | not_applicable | `No changed source or public header under core/libs/prx.` | | python_syntax | passed | `/usr/bin/python3 -m py_compile tools/build_changed_guest_tests.py` | | unit:tools/tests/test_build_changed_guest_tests.py | passed | `/usr/bin/python3 -m unittest tools.tests.test_build_changed_guest_tests` | | python_test_registration | passed | `/usr/bin/python3 tools/check_test_registration.py --scripts` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14414 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14414/stack` | | build_dependent_cpp_tests | not_applicable | `No C/C++ implementation or test files changed.` | | test_quality_heuristics | failed | `/usr/bin/python3 /dev/shm/reviewer-run/precheck/14414/head-917984c07d35-e64ce192/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14414/head-917984c07d35-e64ce192 --json .github/workflows/build.yml tools/build_changed_guest_tests.py tools/tests/test_build_changed_guest_tests.py` | | negative_controls | failed | `A pass means every candidate failed by assertion on base; a failure means at least one did not discriminate or could not run. See per-test results.` | ## Negative control The new `test_output_log_reaches_the_ctest_run` fails on base with `unrecognized arguments: --output-log ctest.log` (argparse exit 2), so it discriminates the change. The precheck classified it `not_executable` because the failure is an argparse exit, not an assertion; that is a label issue, not a weak test. ## Findings **Blocking:** none. **Non-blocking:** - The new `--output-log` is passed only on the pull-request step; the report step's `[ -f ctest.log ] || exit 0` now finds the file on PR runs, as the PR describes. ## Sources - Pull-request step writes the log, head: https://github.com/boykopovar/AnyPS5/blob/917984c07d350c043692a41d9f29ffc718f79c6a/.github/workflows/build.yml#L710 - Report step, head: https://github.com/boykopovar/AnyPS5/blob/917984c07d350c043692a41d9f29ffc718f79c6a/.github/workflows/build.yml#L731-L737 ## Not verified - The Windows warning behaviour on a PR run (the PR's job-level evidence is author-reported) was not reproduced. - `ctest --output-log` on the Windows runner was not run here. - Hosted: windows and relinker ubuntu/windows/asan passed; macOS clang jobs were queued at review time.
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!14414
No description provided.