test: unit tests for tools/gen_gdk_runtime_classes.py (TEST-GEN-GDK-RUNTIME, carry of #340) #3083
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3083"
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 ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T10:29:00Z.
Claimed in the coordination issue as: TEST-GEN-GDK-RUNTIME (the original author's item ID, claimed at https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7140050149)
What and why
Carry of #340 (kotekompotek), unchanged since 2026-11-25. Branch = main + the author's head (commit
cab0e9a59kept) + conflict resolution + my commit.The PR adds unit tests for
tools/gen_gdk_runtime_classes.py(parse_layout,parse_docs,check,revision,main). Since thenmaingained atests/test_gen_gdk_runtime_classes.pywith the atomic-write tests, which is what the review by aslan2142 asked to resolve. The merge resolution keeps all three atomic-write tests and their POSIXresourceguard unchanged, and adds the author's test classes to the same file (shared imports,REPOconstant used for both the script path and thetoolsimport path).Review point fixed in a separate commit: the in-process
gen.maintests printed the tool's progress line and its "no COM folder" error into the test output (raised by Oliwettoo and aslan2142). stdout and stderr are now redirected around those two calls.Not changed here: the missing ID in the original title and the missing claim comment (CONTRIBUTING, raised by Oliwettoo and QemmHD). This carry uses the author's claimed ID, TEST, above.
Tested
Windows 11, no GPU, no game files, on main
a917c54d6plus this branch (e7e75ac62).python -I tests/test_gen_gdk_runtime_classes.py:Ran 9 tests,OK (skipped=2). The two skips are the POSIX-onlyRLIMIT_FSIZEwrite-failure tests, as onmain. No tool output is printed any more.python -I tests/test_ci_registration.py:Ran 18 tests,OK.python -I tests/test_text_write_line_endings.py:Ran 3 tests,OK.tools/gen_gdk_runtime_classes.py(the end-of-listbreakinparse_layoutreplaced bypass, and a changed "has no page" message incheck) and reran the file:FAILED (failures=2, skipped=2), namelyTestParseLayout.test_parses_methods_and_unknown_slotsandTestParseDocsAndCheck.test_parses_classes_and_interfaces_and_detects_missing_links. The mutation was reverted withgit checkout; the working tree is clean.python -I scripts/check_no_game_data.py tests/test_gen_gdk_runtime_classes.py: clean (exit 0).Not run: the full suite, CI.
GPUs tested: n/a (unit tests only)
AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests); separate read-only reviewer agent: Claude Opus 5.5.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (Not applicable: tests only, no translator rule.)Supersedes #340 once merged; the original stays open until a maintainer decides.
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T12:02:26Z.
RUN (independent run on Windows, #3083 head
b83249219, merged locally intomain9b4d71899withgit merge --no-ff, no conflicts. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)cab0e9a59(kotekompotek) is an ancestor of the head through the merge16f30af4f, under its author's name.tests/test_gen_gdk_runtime_classes.pykeepsmain's three atomic-write tests and their POSIXresourceguard. It adds the author's six tests:TestParseLayout(2),TestParseDocsAndCheck(2) andTestBuildAndMain(2). Againstmain, the diff only adds lines, apart from the module docstring and theSCRIPTline, which now uses the sharedREPOconstant.python -I tests/test_gen_gdk_runtime_classes.py -v: main 3 tests OK (2 skipped, "needs POSIX resource limits (RLIMIT_FSIZE)"); merge 9 tests OK (the same 2 skipped). These match the body. The run prints no tool output (no progress line, no "cannot read the docs"), as the follow-up commit says.python -m pytestontest_gdk_runtime_calls,test_gen_gdk_classes_out_dir,test_gen_gdk_runtime_classes,test_ci_registrationandtest_text_write_line_endings: main 48 passed / 2 skipped; merge 54 passed / 2 skipped.mainis possible: this pull request changes only a test file, and withmain's tool its 9 tests pass. The red comes from mutations oftools/gen_gdk_runtime_classes.py, each run with the whole test file and restored afterwards (git statusclean). All 7 are killed:break→passat the end of theLayout:list (test_parses_methods_and_unknown_slots), and a changed "which has no page" message (test_parses_classes_and_interfaces_and_detects_missing_links).IUnknownreported as "IUnknown" instead of null: killed.main()returning 2 instead of 1 when the docs cannot be read: killed (test_main_writes_json_and_handles_missing_docs).*unknown*layout entry kept as text instead of null: killed.main's own three tests let the layout, lowercase-id and inheritance mutations through (3 OK each). So the parsing coverage is new.Not covered here: Linux and macOS (the two
RLIMIT_FSIZEtests are POSIX only and run in CI), and a real xgameruntime-docs clone (synthetic pages only).Verdict: PASS. The six carried tests pass on the merge, they catch every parser and CLI mutation tried, which
main's tests do not, the run is quiet, and the author's commit is kept.Machine: Windows 11 Pro 26300 (NTFS), i9-13900K, 64 GB, CPython 3.13.12 (CI uses 3.12); unit tests only, no GPU or game files used.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:03:42Z.
Merging. Head
b83249219merges cleanly withmain9b4d71899and does not force a rebase of #2566. Independent check on headb83249219: enlight3d's red/green on main + this head (tests only, 3 -> 9 tests, related suite 48 -> 54; 7 of 7 tool mutations killed, where main's 3 tests let the parser ones through), comment 7344756099; kotekompotek's commit from #340 is kept; CI 5/5 green incl. no-game-data; no open review or question. Merged by MoonEyes.AI-assisted (Claude Code).