mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #2300] runtime/test/check_module_names.py: harden preflight, child errors, BOM traces, and atomic report #2304
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2304
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2300
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/check-module-names-safety📝 Commits (1)
fd74088runtime/test/check_module_names.py: add argv/preflight/OSError/BOM guards, atomic report write, and unit tests📊 Changes
2 files changed (+217 additions, -8 deletions)
View changed files
📝
runtime/test/check_module_names.py(+86 -8)➕
tests/test_check_module_names.py(+131 -0)📄 Description
Claimed in the coordination issue as: CHECK-MODULE-NAMES-ARGV-PREFLIGHT-BOM-AND-ATOMIC-REPORT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192800412)
What and why
argv: list[str] | None = Nonetomain(argv=None) -> intinruntime/test/check_module_names.pyand return an explicitint(int(bool(failures))) instead of abool._preflight_paths()validating--loader,--guest,--importer,--dependency(existing files),--work-dir(non-empty and not an existing regular file / non-directory ancestor), and--report(non-empty, non-trailing-separator, non-directory/symlink-dir, valid ancestors) upfront before creating--work-dir.LookupErroralongsideUnicodeErrorinexact_acp(), catch(OSError, subprocess.TimeoutExpired)cleanly insiderun(), and decode JSONL traces withencoding="utf-8-sig", errors="replace".--reportatomically via_write_report_atomic()(sibling temp file, UTF-8newline="\n"with trailing newline,fsync, POSIX mode preservation, transient WindowsPermissionErrorretry, temp cleanup on error).tests/test_check_module_names.py(cross-platform with mocked Windows helpers).Tested
python -I tests/test_check_module_names.py -v: 3 passed, 0 failed (detachedupstream/mainbaseline with only the new test file fails with 8 errors).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q runtime/test/check_module_names.py tests/test_check_module_names.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.