Repository navigation
fix(tools): escape sanitizer report test names - #12493
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed head f05b0d9608e6 and ran the focused sanitizer report test from a clean detached worktree on Linux/Python 3.11: relinker-only CMake configure succeeded and ctest -R ^sanitizer_report$ passed (1/1). tools/check_conventions.py --base upstream/main and tools/check_test_registration.py --scripts also passed. The helper preserves the existing backtick representation for ordinary names and switches special names to HTML code spans with Markdown-significant punctuation encoded; it is used in all five summary tables. The new test exercises failure, known-failure, recovered, and absent-name rows with pipes, backticks, line breaks, backslashes, angle brackets, ampersands, and Unicode. I found no correctness issue in this focused review. Eligibility passed; hosted conventions/intake/labels and the relinker matrix were still pending at my last check, so this comment is not an approval or a claim that hosted CI passed.
rooklz
left a comment
There was a problem hiding this comment.
Reviewed head f05b0d9608 on macOS 26.2 (arm64). This was the first macOS run. All findings are from the host; no console was used.
test_sanitizer_report: OK on Python 3.9.6 and 3.13. 3.14 errors only because of a local Homebrewpyexpatbreakage, which is environmental. Main'stools/sanitizer_report.pywith the PR test is RED: 20 failures.check_conventions --base upstream/mainclean.merge-treeagainst maine4da19aff0clean. The exact head also merge-trees cleanly with #12437 (the shared-file pair the bot could not compare).check_test_registration --scriptsreports 212.- I used GitHub's own renderer (
gh api markdown -f mode=gfm) as an oracle on the generated tables. With this head,a|b\|c,x|*em*,only\rcr,p|<qand`t`each render as one<td><code>showing exactly the literal name.
Mutants (8): no-pipe-trigger, no-backtick-trigger and no-CR-escape are killed. Two survive, and the renderer shows that both change visible output:
- Dropping
\rfrom the trigger set ("|\n").only\rcrfalls back to backticks, and GFM splits the row into two table rows (``only/cr``). The test nameline\nnext\rreturnalways trips the\n` branch first, so CR-only names are never exercised. - Leaving backslash/
*/&unencoded in the<code>span.a|b\|crenders asa|b|c, because\&becomes a Markdown escape, andx|*em*renders as<em>.html.unescaperound-trips these unchanged, so the test can't tell.
The test-only diff below kills both (head OK on 3.9.6/3.13; mutant 1 RED 5, mutant 2 RED 15; main RED 25). It pins the documented "everything except alphanumerics and space is encoded":
- names = ("one|two", "`fence`", "line\nnext\rreturn", "\\|<script>&中文")
+ names = ("one|two", "`fence`", "line\nnext\rreturn", "carriage\rreturn", "\\|<script>&中文*_")
@@
self.assertEqual(html.unescape(encoded), name.replace("\r", r"\r").replace("\n", r"\n"))
+ self.assertRegex(encoded, r"\A(?:[^\W_]| |&#\d+;)*\Z")Not blocking. The production code is correct; this only hardens the test. Nit: the local import html inside the test could live at module level.
# Conflicts: # tools/tests/test_sanitizer_report.py
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 88e0f5154921cf3db0c5ef942f7685f171acd232 against 3a2b91981651569163768854a1fcdc7193b6667b. Markdown test names containing delimiters or line breaks are emitted as encoded code content across failed, known, recovered and absent-test tables. Ordinary names keep their inline-code rendering. The branch also gives explicit JUnit failure/error elements precedence over skip metadata. No actionable finding in this scoped review.
Windows/Python 3.11 validation: head 27 passed, 2 skipped; baseline 25 passed, 2 skipped. The new rendering/contradictory-status assertions fail on old production. Platform symbolic-link cases are skipped. This is report generation from fixture JUnit input, not a sanitizer execution.
|
Review-fix follow-up for head Integrated prerequisite #12483 at 53afb74 while retaining both literal-name rendering and explicit-failure precedence, plus main's summary/input alias protection. Strengthened the fixture with a carriage-return-only name and independent encoding assertions for backslashes, Markdown punctuation and ampersands. Recorded validation at this exact head: the registered sanitizer_report group passes on Windows/Linux (29 Python tests; two existing Windows symlink-privilege skips, none on Linux). Both rendering and contradictory-failure regressions execute. Removing either the carriage-return trigger or the literal-character encoding makes the production-shadow control fail its assertions on both OSes. Conventions, whitespace, registration and skip-policy checks pass. #12483 remains a declared prerequisite; no local GitHub-renderer run is claimed. The local validation above was recorded for this exact PR head; this comment supplies the missing follow-up summary. Detailed commands and scope remain in the PR description. Hosted-check snapshot checked on 2026-10-30 for this head: 8 passed, 4 skipped; no failures. Current checks. Skipped checks are excluded from the pass count. AI-assisted: yes. |
|
Updated to The combined implementation preserves explicit failure precedence, input-alias protection, symlink-loop handling and JSON output. Added a real CLI regression: special JUnit names remain unchanged in JSON, appended Markdown renders literal cells, contradictory skipped/failed cases exit 1, and the input is not modified. Validation on the exact published head:
Please recheck the updated head. Fresh hosted CI is tracked below; historical-head results are not substituted for it. AI-assisted: yes. Fresh hosted CI for
Skipped jobs are the unchanged full-runtime/platform-specific jobs excluded by the tools-only change eligibility gate. They are not counted as passes. |
What
Render sanitizer test names containing table/Markdown control characters as literal encoded code spans, preserving ordinary names and failure accounting.
Integrate current main after prerequisite #12483 merged. Keep its explicit-failure precedence, summary-input alias protection, symlink-loop error handling and JSON output. No open prerequisite remains; the PR diff changes only the name renderer and its regression tests.
Cover all five summary tables, carriage-return-only names, literal backslashes, Markdown punctuation and ampersands. Add a real CLI regression combining contradictory skipped/failed JUnit entries with special names: JSON keeps the original names, Markdown appends safe literal cells, the source report stays unchanged, and unexpected failures still exit 1.
Tested
Exact tested head:
36bcf0ce9cc2efd9fc6bd47cc58a16d96519476d, including maind0913992db901fcf4cba0bcb7b9a81284080eda6and merged prerequisite #12483 (53afb7481500f00bc9918fdb45bb2577708e4f06).Windows 11 / MinGW GCC 15.2 / CMake 4.3.1 / Python 3.12.14 and 3.14.3; WSL Ubuntu 26.04 / GCC 15.2 / CMake 4.2.3 / Python 3.12.16 and 3.14.4. Separate Ninja Release configurations use
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ONand each selected interpreter. The relinker builds successfully on both platforms.ctest --test-dir BUILD -R '^(sanitizer_report|tools_sanitizer_json|test_script_registration)$' -V --output-on-failure --no-tests=error: all 3 registered groups pass in each of the four configurations. The two Python suites run 33 test methods; longest group is 2.20 seconds.These are focused tool and relinker checks. No full system-library build, local macOS runtime, GitHub-renderer exercise, GPU validation or title run is claimed. Hosted CI for the updated head is reported separately after publication.
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)