ci: run every test under ASan and UBSan nightly #11062

Merged
MarcZX10 merged 36 commits from upstream-pr/11062 into main 2026-10-27 16:58:35 +00:00
MarcZX10 commented 2026-10-25 16:19:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T16:19:30Z.


What

Nothing runs the test suite under sanitizers today. -DANYPS5_ENABLE_ASAN=ON exists, but only people who build it locally see what it finds. This adds a nightly workflow (.github/workflows/sanitizers.yml, cron: '41 3 * * *' plus workflow_dispatch). It builds every test on ubuntu-latest with ASan and UBSan (-fsanitize=undefined -fno-sanitize=vptr, UBSAN_OPTIONS=halt_on_error=1, ASAN_OPTIONS=detect_leaks=0), runs ctest --output-junit and fails only on failures that are not already known.

  • tools/sanitizer_report.py reads the JUnit file and writes a job summary: failed tests with the first sanitizer report line of each (SUMMARY:, ERROR:/WARNING: or runtime error:), known failures, known failures that now pass and known failures not in the run. Real skips (SKIP_RETURN_CODE, SKIP_REGULAR_EXPRESSION_MATCHED) count as skipped, and any other not-run test (for example "Unable to find executable") counts as failed. An empty report is rejected, so a broken build cannot look green.
  • .github/sanitizer-known-failures.txt lists 8 known failures as test sanitizers reason. Each reason names the cause and, where one exists, the open pull request that fixes it (#10973, #11059). A test listed as known that starts passing is reported, so the list can shrink as those merge.
  • Gating: the build, test and summary steps run only if configuration succeeded. agc_driver_guest_memory_lifetime_converted gets verify_asan_link_order=0, like the other converted AGC tests.
  • Docs: BUILD.md describes the workflow next to the ASan flag.

A run of this branch on a fork (plus a push trigger), rebased on main after #9548 and #9133 were merged: 2,286 tests, 1,554 passed, 719 skipped and 13 failed. 12 of those failures were on the list. The 13th was guest_posix_spawn, a test #9133 added, whose child's deliberate SIGBUS ASan intercepts; #11239 fixes it and it is now listed. The four LibAtrac9 shift entries passed after #9548, so they were removed. After #9710 was merged, atrac9_gradient links and passes in a targeted ASan and UBSan run of this branch, so its entry was removed too. After #9711, #10829, #10921, #10968 and #11239 were merged, input_magic, guest_sce_v2_exceptions, guest_system_configuration, guest_convert_keycode and guest_posix_spawn passed in a targeted ASan and UBSan run of this branch, so their entries were removed as well. The job stays well inside its 330-minute timeout, on free standard runners for this public repository. Notifications for a failing scheduled run go to whoever last changed the cron line. A known entry masks the whole test for the listed sanitizers, so a new problem in a listed test is only seen once its entry is removed.

docs/dev/BUILD.md also gets a paragraph in #11059 at the same spot; whichever merges second needs a one-line rebase.

Tested

  • Linux x86-64, Python 3.11: tools/tests/test_sanitizer_report.py passes (summary, known, passing-known, missing-known, not-run, skipped, empty-report and first-report cases, plus a check that the repository's list parses and is sorted). It is registered as the sanitizer_report ctest.
  • Fork trials on ubuntu-latest (Ubuntu GCC 15.2): the first trial exposed the missing libxrandr-dev and green steps after a failed configure, both fixed in this branch. A second trial ran the full suite and led to the list changes in the last three commits; a third trial, on the branch rebased on main as of then, passed with every failure on the list; a fourth, after #9548 and #9133, gave the results above and the last two list commits.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main pass. tools/pr_overlap.py --branch reports only shared CMakeLists.txt files, plus the BUILD.md overlap with #11059 noted above.

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 (not applicable; no third-party code added)
  • Generic behaviour, not specific to one title
  • Depends on: #11059 (merge order only; no functional dependency)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5006458077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11062). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T16:19:30Z. --- ### What Nothing runs the test suite under sanitizers today. `-DANYPS5_ENABLE_ASAN=ON` exists, but only people who build it locally see what it finds. This adds a nightly workflow (`.github/workflows/sanitizers.yml`, `cron: '41 3 * * *'` plus `workflow_dispatch`). It builds every test on `ubuntu-latest` with ASan and UBSan (`-fsanitize=undefined -fno-sanitize=vptr`, `UBSAN_OPTIONS=halt_on_error=1`, `ASAN_OPTIONS=detect_leaks=0`), runs `ctest --output-junit` and fails only on failures that are not already known. - **`tools/sanitizer_report.py`** reads the JUnit file and writes a job summary: failed tests with the first sanitizer report line of each (`SUMMARY:`, `ERROR:`/`WARNING:` or `runtime error:`), known failures, known failures that now pass and known failures not in the run. Real skips (`SKIP_RETURN_CODE`, `SKIP_REGULAR_EXPRESSION_MATCHED`) count as skipped, and any other not-run test (for example "Unable to find executable") counts as failed. An empty report is rejected, so a broken build cannot look green. - **`.github/sanitizer-known-failures.txt`** lists 8 known failures as `test sanitizers reason`. Each reason names the cause and, where one exists, the open pull request that fixes it (#10973, #11059). A test listed as known that starts passing is reported, so the list can shrink as those merge. - **Gating:** the build, test and summary steps run only if configuration succeeded. `agc_driver_guest_memory_lifetime_converted` gets `verify_asan_link_order=0`, like the other converted AGC tests. - **Docs:** BUILD.md describes the workflow next to the ASan flag. A run of this branch on a fork (plus a push trigger), rebased on `main` after #9548 and #9133 were merged: 2,286 tests, 1,554 passed, 719 skipped and 13 failed. 12 of those failures were on the list. The 13th was `guest_posix_spawn`, a test #9133 added, whose child's deliberate `SIGBUS` ASan intercepts; #11239 fixes it and it is now listed. The four LibAtrac9 shift entries passed after #9548, so they were removed. After #9710 was merged, `atrac9_gradient` links and passes in a targeted ASan and UBSan run of this branch, so its entry was removed too. After #9711, #10829, #10921, #10968 and #11239 were merged, `input_magic`, `guest_sce_v2_exceptions`, `guest_system_configuration`, `guest_convert_keycode` and `guest_posix_spawn` passed in a targeted ASan and UBSan run of this branch, so their entries were removed as well. The job stays well inside its 330-minute timeout, on free standard runners for this public repository. Notifications for a failing scheduled run go to whoever last changed the cron line. A known entry masks the whole test for the listed sanitizers, so a new problem in a listed test is only seen once its entry is removed. `docs/dev/BUILD.md` also gets a paragraph in #11059 at the same spot; whichever merges second needs a one-line rebase. ### Tested - Linux x86-64, Python 3.11: `tools/tests/test_sanitizer_report.py` passes (summary, known, passing-known, missing-known, not-run, skipped, empty-report and first-report cases, plus a check that the repository's list parses and is sorted). It is registered as the `sanitizer_report` ctest. - Fork trials on `ubuntu-latest` (Ubuntu GCC 15.2): the first trial exposed the missing `libxrandr-dev` and green steps after a failed configure, both fixed in this branch. A second trial ran the full suite and led to the list changes in the last three commits; a third trial, on the branch rebased on `main` as of then, passed with every failure on the list; a fourth, after #9548 and #9133, gave the results above and the last two list commits. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main` pass. `tools/pr_overlap.py --branch` reports only shared `CMakeLists.txt` files, plus the BUILD.md overlap with #11059 noted above. ### 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 (not applicable; no third-party code added) - [x] Generic behaviour, not specific to one title - [x] Depends on: #11059 (merge order only; no functional dependency) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
thepoppfish commented 2026-10-25 16:44:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T16:44:06Z.

Review: APPROVED


Reviewed exact head 15f7d26023d775dd43fd44f997d38b36175ce6f0 against main 0119103fa9ed65a894a931da02b6510669991b45. Approve; no blocking findings in the reporting/workflow diff.

Independent reporting validation on Windows 11 build 26200, Python 3.14.7 and CMake/CTest 4.3.1:

  • python tools/tests/test_sanitizer_report.py -v: 21 tests pass, zero skips, 0.529s. Conventions and whitespace checks pass; source checkout remains clean.
  • Generated actual JUnit XML with CTest using a standalone project, rather than hand-writing the XML: passing/failing commands, return-code skips77 and0, regex skip, disabled test, timeout, missing executable, and a dependent test blocked by a failed setup fixture. Four CTest runs and12 real reporter CLI invocations across address/undefined/combined known selections produce the expected classifications and exit codes. In the11-case run, the reporter counts 1 passed,4 skipped,6 failed; both Unable to find executable and Fixture dependency failed remain failures. The known-only subset exits0 only for the matching sanitizer selection. An empty CTest report exits2 without appending a success summary. UTF-8 report/known/summary paths and repeated summary appends also pass. The diagnostic string in this standalone fixture is synthetic; no local sanitizer runtime was involved.
  • Downloaded artifact 12598829012, sanitizer-tests, from the completed fork trial40189756924, trial head e6910888b741bd7b201da1792dd5ae9dc7e67b32. Replaying its unmodified XML through this PR's reporter gives 2,215 tests:1,490 passed,708 skipped,17 failed. With the current known list and both sanitizers it exits0 with all17 explicitly known; without the known list it exits1. Removing only guest_math from a scratch copy of the list also restores exit1 and identifies it as unexpected, leaving16 known. This confirms the positive/negative gating paths on the actual Linux run's data, including atrac9_gradient as Not Run.

The trial's reporter source is identical to this head. Its workflow differs only by the fork-only push trigger and a trailing colon in ASAN_OPTIONS; I inspected those differences. The completed trial job itself is failed, at its summary step; replaying its artifact with the updated known list is not a claim that the original job passed. JUnit SHA-256: 3f9cc21dbef087bcb716f1a65dec91022c8363649c518e1a333bf99c1d77b14c.

The known list deliberately masks an entire listed test, as the PR description acknowledges; a different failure within that same test is not independently detected by this scheme. The recovered/missing-known tables help maintain the list but do not remove that limitation.

I reviewed the configuration-success gates, permissions, schedule-only/manual triggers, continued-build/report gating, test registration and the ASan environment append helper. The latter preserves the inherited options while appending verify_asan_link_order=0. I did not run a new full Linux ASan/UBSan build, Vulkan baseline/change comparison, title or GPU test, or certify the newer in-progress fork trial. This approval uses local reporter/CTest execution and replay of the pinned completed trial above.

To replay the real archived input against this head:

gh run download 40189756924 --repo MarcZX10/AnyPS5 --name sanitizer-tests --dir trial
python tools/sanitizer_report.py trial/ctest.xml
python tools/sanitizer_report.py trial/ctest.xml --known .github/sanitizer-known-failures.txt --sanitizer address --sanitizer undefined

Expected exits are1 and0. The full standalone CTest probe is below for the additional status and summary checks.

Standalone CTest / reporter probe

Save as probe-sanitizer-ctest.py and run with CMake/Ninja on PATH:

python probe-sanitizer-ctest.py <head-checkout> native-ctest-results.json

It creates only a temporary external project, asserts the exact PR head and leaves the checkout untouched.

import importlib.util
import json
from pathlib import Path
import subprocess
import sys
import tempfile
import xml.etree.ElementTree as ET


def main():
    repo, destination = map(Path, sys.argv[1:])
    repo = repo.resolve()
    assert subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=repo, text=True).strip() == "15f7d26023d775dd43fd44f997d38b36175ce6f0"
    reporter = repo / "tools/sanitizer_report.py"
    spec = importlib.util.spec_from_file_location("reporter", reporter)
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)
    records = []
    with tempfile.TemporaryDirectory(prefix="anyps5-sanitizer-ctest-") as temporary:
        work = Path(temporary) / "café-בדיקה"
        work.mkdir()
        source, build = Path(temporary) / "source", Path(temporary) / "build"
        source.mkdir()
        helper = source / "cases.py"
        helper.write_text("import sys,time\nmode=sys.argv[1]\n"
                          "if mode == 'timeout': time.sleep(5)\n"
                          "if mode == 'regex': print('SKIP_THIS_CASE')\n"
                          "if mode == 'known': print('SUMMARY: AddressSanitizer: synthetic-fixture-only')\n"
                          "sys.exit({'pass':0,'fail':1,'known':1,'skip':77,'zero':0,'regex':0,'timeout':0}[mode])\n", encoding="utf-8")
        cmake = ['cmake_minimum_required(VERSION 3.21)', 'project(ReporterProbe LANGUAGES NONE)', 'enable_testing()']
        definitions = [("passes", "pass"), ("plain_fail", "fail"), ("known_fail", "known"), ("skip_code", "skip"),
                       ("skip_zero", "zero"), ("skip_regex", "regex"), ("disabled", "fail"), ("timeout", "timeout"),
                       ("setup_fails", "fail"), ("needs_fixture", "pass")]
        for name, mode in definitions:
            cmake.append(f'add_test(NAME {name} COMMAND "{Path(sys.executable).as_posix()}" "{helper.as_posix()}" {mode})')
        cmake += [f'add_test(NAME missing COMMAND "{(source / "does-not-exist.exe").as_posix()}")',
                  'set_tests_properties(skip_code PROPERTIES SKIP_RETURN_CODE 77)',
                  'set_tests_properties(skip_zero PROPERTIES SKIP_RETURN_CODE 0)',
                  'set_tests_properties(skip_regex PROPERTIES SKIP_REGULAR_EXPRESSION "SKIP_THIS_CASE")',
                  'set_tests_properties(disabled PROPERTIES DISABLED TRUE)',
                  'set_tests_properties(timeout PROPERTIES TIMEOUT 0.2)',
                  'set_tests_properties(setup_fails PROPERTIES FIXTURES_SETUP broken_fixture)',
                  'set_tests_properties(needs_fixture PROPERTIES FIXTURES_REQUIRED broken_fixture)']
        (source / "CMakeLists.txt").write_text("\n".join(cmake) + "\n", encoding="utf-8")
        configure = subprocess.run(["cmake", "-S", str(source), "-B", str(build), "-G", "Ninja"], capture_output=True, text=True, encoding="utf-8")
        assert configure.returncode == 0, configure.stderr
        expected = {"passes":"passed", "plain_fail":"failed", "known_fail":"failed", "skip_code":"skipped", "skip_zero":"skipped",
                    "skip_regex":"skipped", "disabled":"skipped", "missing":"failed", "timeout":"failed", "setup_fails":"failed", "needs_fixture":"failed"}
        selected = {"all": (None, expected, 8),
                    "known-and-skips": ("^(passes|known_fail|skip_code|skip_zero|skip_regex|disabled)$", {name:value for name,value in expected.items() if name in {"passes","known_fail","skip_code","skip_zero","skip_regex","disabled"}}, 8),
                    "skips-only": ("^(skip_code|skip_zero|skip_regex|disabled)$", {name:"skipped" for name in ("skip_code","skip_zero","skip_regex","disabled")}, 0),
                    "empty": ("^there_are_no_such_tests$", {}, 0)}
        known = work / "known.txt"
        known.write_text("known_fail address fixture failure\npasses undefined recovered fixture\nabsent address old test name\n", encoding="utf-8")
        summary = work / "summary.md"
        summary.write_text("Existing summary\n", encoding="utf-8")
        concatenated = "Existing summary\n"
        for label, (pattern, outcomes, ctest_exit) in selected.items():
            junit = work / (label + ".xml")
            command = ["ctest", "--test-dir", str(build), "--output-on-failure", "--output-junit", str(junit), "-j", "1"]
            if pattern:
                command += ["-R", pattern]
            run = subprocess.run(command, capture_output=True, text=True, encoding="utf-8")
            assert run.returncode == ctest_exit, (label, run.returncode, run.stdout, run.stderr)
            if outcomes:
                found = module.results(junit)
                assert found == outcomes, (label, found, outcomes)
            for sanitizers in (("address",), ("undefined",), ("address", "undefined")):
                args = [str(reporter), str(junit), "--known", str(known), "--summary", str(summary)]
                for sanitizer in sanitizers:
                    args += ["--sanitizer", sanitizer]
                report = subprocess.run([sys.executable, *args], capture_output=True, text=True, encoding="utf-8")
                expected_exit = 2 if not outcomes else int(any(value == "failed" and (name != "known_fail" or "address" not in sanitizers) for name,value in outcomes.items()))
                assert report.returncode == expected_exit, (label, sanitizers, report.returncode, expected_exit, report.stdout, report.stderr)
                if outcomes:
                    concatenated += report.stdout
                    assert "`absent`" in report.stdout if "address" in sanitizers else "`absent`" not in report.stdout
                    if "undefined" in sanitizers and "passes" in outcomes:
                        assert "Listed as known but passed" in report.stdout
                else:
                    assert report.stdout == "" and "lists no tests" in report.stderr
                assert summary.read_text(encoding="utf-8") == concatenated
                records.append({"case":label,"sanitizers":sanitizers,"ctest_exit":run.returncode,"reporter_exit":report.returncode,"stdout":report.stdout,"stderr":report.stderr})
        xml = ET.parse(work / "all.xml").getroot()
        statuses = [{"name":case.get("name"),"status":case.get("status"),"skipped_message":case.find("skipped").get("message") if case.find("skipped") is not None else None} for case in xml.iter("testcase")]
    destination.write_text(json.dumps({"head":"15f7d26023d775dd43fd44f997d38b36175ce6f0","ctest_runs":4,"reporter_cli_runs":len(records),"classifications":expected,"native_junit_statuses":statuses,"cases":records},indent=2)+"\n",encoding="utf-8")
    print(json.dumps({"ctest_runs":4,"reporter_cli_runs":len(records),"classifications":expected}))


if __name__ == "__main__":
    main()

AI-assisted review and probe; the stated local commands and archived-data replays were actually run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644181646 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11062#pullrequestreview-5644181646). Originally posted by [thepoppfish](https://github.com/thepoppfish) on 2026-10-25T16:44:06Z. **Review:** APPROVED --- Reviewed exact head `15f7d26023d775dd43fd44f997d38b36175ce6f0` against main `0119103fa9ed65a894a931da02b6510669991b45`. Approve; no blocking findings in the reporting/workflow diff. Independent reporting validation on Windows 11 build 26200, Python 3.14.7 and CMake/CTest 4.3.1: - `python tools/tests/test_sanitizer_report.py -v`: **21 tests pass**, zero skips, 0.529s. Conventions and whitespace checks pass; source checkout remains clean. - Generated actual JUnit XML with CTest using a standalone project, rather than hand-writing the XML: passing/failing commands, return-code skips77 and0, regex skip, disabled test, timeout, missing executable, and a dependent test blocked by a failed setup fixture. **Four CTest runs and12 real reporter CLI invocations** across address/undefined/combined known selections produce the expected classifications and exit codes. In the11-case run, the reporter counts **1 passed,4 skipped,6 failed**; both `Unable to find executable` and `Fixture dependency failed` remain failures. The known-only subset exits0 only for the matching sanitizer selection. An empty CTest report exits2 without appending a success summary. UTF-8 report/known/summary paths and repeated summary appends also pass. The diagnostic string in this standalone fixture is synthetic; no local sanitizer runtime was involved. - Downloaded artifact **12598829012**, `sanitizer-tests`, from the completed [fork trial40189756924](https://github.com/MarcZX10/AnyPS5/actions/runs/40189756924), trial head `e6910888b741bd7b201da1792dd5ae9dc7e67b32`. Replaying its unmodified XML through this PR's reporter gives **2,215 tests:1,490 passed,708 skipped,17 failed**. With the current known list and both sanitizers it exits0 with all17 explicitly known; without the known list it exits1. Removing only `guest_math` from a scratch copy of the list also restores exit1 and identifies it as unexpected, leaving16 known. This confirms the positive/negative gating paths on the actual Linux run's data, including `atrac9_gradient` as Not Run. The trial's reporter source is identical to this head. Its workflow differs only by the fork-only push trigger and a trailing colon in `ASAN_OPTIONS`; I inspected those differences. The completed trial job itself is **failed**, at its summary step; replaying its artifact with the updated known list is not a claim that the original job passed. JUnit SHA-256: `3f9cc21dbef087bcb716f1a65dec91022c8363649c518e1a333bf99c1d77b14c`. The known list deliberately masks an entire listed test, as the PR description acknowledges; a different failure within that same test is not independently detected by this scheme. The recovered/missing-known tables help maintain the list but do not remove that limitation. I reviewed the configuration-success gates, permissions, schedule-only/manual triggers, continued-build/report gating, test registration and the ASan environment append helper. The latter preserves the inherited options while appending `verify_asan_link_order=0`. I did **not** run a new full Linux ASan/UBSan build, Vulkan baseline/change comparison, title or GPU test, or certify the newer in-progress fork trial. This approval uses local reporter/CTest execution and replay of the pinned completed trial above. To replay the real archived input against this head: ```text gh run download 40189756924 --repo MarcZX10/AnyPS5 --name sanitizer-tests --dir trial python tools/sanitizer_report.py trial/ctest.xml python tools/sanitizer_report.py trial/ctest.xml --known .github/sanitizer-known-failures.txt --sanitizer address --sanitizer undefined ``` Expected exits are1 and0. The full standalone CTest probe is below for the additional status and summary checks. <details> <summary>Standalone CTest / reporter probe</summary> Save as `probe-sanitizer-ctest.py` and run with CMake/Ninja on PATH: ```text python probe-sanitizer-ctest.py <head-checkout> native-ctest-results.json ``` It creates only a temporary external project, asserts the exact PR head and leaves the checkout untouched. ```python import importlib.util import json from pathlib import Path import subprocess import sys import tempfile import xml.etree.ElementTree as ET def main(): repo, destination = map(Path, sys.argv[1:]) repo = repo.resolve() assert subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=repo, text=True).strip() == "15f7d26023d775dd43fd44f997d38b36175ce6f0" reporter = repo / "tools/sanitizer_report.py" spec = importlib.util.spec_from_file_location("reporter", reporter) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) records = [] with tempfile.TemporaryDirectory(prefix="anyps5-sanitizer-ctest-") as temporary: work = Path(temporary) / "café-בדיקה" work.mkdir() source, build = Path(temporary) / "source", Path(temporary) / "build" source.mkdir() helper = source / "cases.py" helper.write_text("import sys,time\nmode=sys.argv[1]\n" "if mode == 'timeout': time.sleep(5)\n" "if mode == 'regex': print('SKIP_THIS_CASE')\n" "if mode == 'known': print('SUMMARY: AddressSanitizer: synthetic-fixture-only')\n" "sys.exit({'pass':0,'fail':1,'known':1,'skip':77,'zero':0,'regex':0,'timeout':0}[mode])\n", encoding="utf-8") cmake = ['cmake_minimum_required(VERSION 3.21)', 'project(ReporterProbe LANGUAGES NONE)', 'enable_testing()'] definitions = [("passes", "pass"), ("plain_fail", "fail"), ("known_fail", "known"), ("skip_code", "skip"), ("skip_zero", "zero"), ("skip_regex", "regex"), ("disabled", "fail"), ("timeout", "timeout"), ("setup_fails", "fail"), ("needs_fixture", "pass")] for name, mode in definitions: cmake.append(f'add_test(NAME {name} COMMAND "{Path(sys.executable).as_posix()}" "{helper.as_posix()}" {mode})') cmake += [f'add_test(NAME missing COMMAND "{(source / "does-not-exist.exe").as_posix()}")', 'set_tests_properties(skip_code PROPERTIES SKIP_RETURN_CODE 77)', 'set_tests_properties(skip_zero PROPERTIES SKIP_RETURN_CODE 0)', 'set_tests_properties(skip_regex PROPERTIES SKIP_REGULAR_EXPRESSION "SKIP_THIS_CASE")', 'set_tests_properties(disabled PROPERTIES DISABLED TRUE)', 'set_tests_properties(timeout PROPERTIES TIMEOUT 0.2)', 'set_tests_properties(setup_fails PROPERTIES FIXTURES_SETUP broken_fixture)', 'set_tests_properties(needs_fixture PROPERTIES FIXTURES_REQUIRED broken_fixture)'] (source / "CMakeLists.txt").write_text("\n".join(cmake) + "\n", encoding="utf-8") configure = subprocess.run(["cmake", "-S", str(source), "-B", str(build), "-G", "Ninja"], capture_output=True, text=True, encoding="utf-8") assert configure.returncode == 0, configure.stderr expected = {"passes":"passed", "plain_fail":"failed", "known_fail":"failed", "skip_code":"skipped", "skip_zero":"skipped", "skip_regex":"skipped", "disabled":"skipped", "missing":"failed", "timeout":"failed", "setup_fails":"failed", "needs_fixture":"failed"} selected = {"all": (None, expected, 8), "known-and-skips": ("^(passes|known_fail|skip_code|skip_zero|skip_regex|disabled)$", {name:value for name,value in expected.items() if name in {"passes","known_fail","skip_code","skip_zero","skip_regex","disabled"}}, 8), "skips-only": ("^(skip_code|skip_zero|skip_regex|disabled)$", {name:"skipped" for name in ("skip_code","skip_zero","skip_regex","disabled")}, 0), "empty": ("^there_are_no_such_tests$", {}, 0)} known = work / "known.txt" known.write_text("known_fail address fixture failure\npasses undefined recovered fixture\nabsent address old test name\n", encoding="utf-8") summary = work / "summary.md" summary.write_text("Existing summary\n", encoding="utf-8") concatenated = "Existing summary\n" for label, (pattern, outcomes, ctest_exit) in selected.items(): junit = work / (label + ".xml") command = ["ctest", "--test-dir", str(build), "--output-on-failure", "--output-junit", str(junit), "-j", "1"] if pattern: command += ["-R", pattern] run = subprocess.run(command, capture_output=True, text=True, encoding="utf-8") assert run.returncode == ctest_exit, (label, run.returncode, run.stdout, run.stderr) if outcomes: found = module.results(junit) assert found == outcomes, (label, found, outcomes) for sanitizers in (("address",), ("undefined",), ("address", "undefined")): args = [str(reporter), str(junit), "--known", str(known), "--summary", str(summary)] for sanitizer in sanitizers: args += ["--sanitizer", sanitizer] report = subprocess.run([sys.executable, *args], capture_output=True, text=True, encoding="utf-8") expected_exit = 2 if not outcomes else int(any(value == "failed" and (name != "known_fail" or "address" not in sanitizers) for name,value in outcomes.items())) assert report.returncode == expected_exit, (label, sanitizers, report.returncode, expected_exit, report.stdout, report.stderr) if outcomes: concatenated += report.stdout assert "`absent`" in report.stdout if "address" in sanitizers else "`absent`" not in report.stdout if "undefined" in sanitizers and "passes" in outcomes: assert "Listed as known but passed" in report.stdout else: assert report.stdout == "" and "lists no tests" in report.stderr assert summary.read_text(encoding="utf-8") == concatenated records.append({"case":label,"sanitizers":sanitizers,"ctest_exit":run.returncode,"reporter_exit":report.returncode,"stdout":report.stdout,"stderr":report.stderr}) xml = ET.parse(work / "all.xml").getroot() statuses = [{"name":case.get("name"),"status":case.get("status"),"skipped_message":case.find("skipped").get("message") if case.find("skipped") is not None else None} for case in xml.iter("testcase")] destination.write_text(json.dumps({"head":"15f7d26023d775dd43fd44f997d38b36175ce6f0","ctest_runs":4,"reporter_cli_runs":len(records),"classifications":expected,"native_junit_statuses":statuses,"cases":records},indent=2)+"\n",encoding="utf-8") print(json.dumps({"ctest_runs":4,"reporter_cli_runs":len(records),"classifications":expected})) if __name__ == "__main__": main() ``` </details> AI-assisted review and probe; the stated local commands and archived-data replays were actually run.
THEMANnt commented 2026-10-26 19:21:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-26T19:21:16Z.

Review: APPROVED


Reviewed 2d04e57a5753c1dbf94aa1369a0465541fcf58b3. Approve; no actionable finding in this focused review.

The nightly workflow retains JUnit/log artifacts and routes results through a reporter that distinguishes unexpected failures, known failures, skips, recovered entries and missing tests. Missing/malformed input is an error rather than a clean empty run.

Validation: Windows/Python 3.11: all 21 reporter tests pass, including CTest not-run/skip classification and known-failure handling. Reviewed the workflow, allowlist, registration and existing ASan test option integration.

Scope / next step: The new reporter is absent from the base; its import failure there is an API-addition control only. No full Linux ASan/UBSan nightly run was executed locally.

The final update changes only explanations/references in the known-failure list; reporter, workflow and tests are byte-identical to the initially tested head. I reran all 21 tests, including repository-list parsing, on this updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5657733368 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11062#pullrequestreview-5657733368). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-26T19:21:16Z. **Review:** APPROVED --- Reviewed `2d04e57a5753c1dbf94aa1369a0465541fcf58b3`. Approve; no actionable finding in this focused review. The nightly workflow retains JUnit/log artifacts and routes results through a reporter that distinguishes unexpected failures, known failures, skips, recovered entries and missing tests. Missing/malformed input is an error rather than a clean empty run. **Validation:** Windows/Python 3.11: all 21 reporter tests pass, including CTest not-run/skip classification and known-failure handling. Reviewed the workflow, allowlist, registration and existing ASan test option integration. **Scope / next step:** The new reporter is absent from the base; its import failure there is an API-addition control only. No full Linux ASan/UBSan nightly run was executed locally. The final update changes only explanations/references in the known-failure list; reporter, workflow and tests are byte-identical to the initially tested head. I reran all 21 tests, including repository-list parsing, on this updated head.
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!11062
No description provided.