tools/script_qtable: add empty --json and atomic write regression tests (SCRIPT-QTABLE-ATOMIC-JSON) #2005

Open
github-bot wants to merge 2 commits from github-bot/gh-2005 into main AGit
Owner

@⁠Ch1mpleo on GitHub · 2026-11-25 17:57 UTC · original
Ch1mpleo:fix/script-qtable-atomic-json → main · +29 −0 · 1 files · 2 commits · open

Claimed in the coordination issue as: SCRIPT-QTABLE-ATOMIC-JSON (#1608)

What and why

Adds \ est_empty_json_rejected_and_atomic_write_preserves_existing\ to \ ests/test_script_qtable.py\ (and _write_json_atomic\ helper in \ ools/script_qtable.py) verifying empty --json\ refusal and atomic JSON write preservation on
eplace_retry\ failure.

Tested

  • \python -m compileall -q tools/script_qtable.py tests/test_script_qtable.py\ — exit 0.
  • \python -I tests/test_script_qtable.py\ — 15 tests (14 passed, 1 skipped; Windows 11 x64, Python 3.14.7).
  • \python -I scripts/check_no_game_data.py tools/script_qtable.py tests/test_script_qtable.py\ — exit 0.

GPUs tested: n/a (CPU-only Python tool & unit tests)

AI-assisted: yes

Checklist

  • Based on current \main\ and merges cleanly (a conflicting pull request is labeled
    eeds rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of \docs/design.md, with how it was confirmed. (n/a — no translator change)
**@⁠Ch1mpleo** on GitHub · 2026-11-25 17:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2005) `Ch1mpleo:fix/script-qtable-atomic-json` → `main` · +29 −0 · 1 files · 2 commits · open Claimed in the coordination issue as: SCRIPT-QTABLE-ATOMIC-JSON (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why Adds \ est_empty_json_rejected_and_atomic_write_preserves_existing\ to \ ests/test_script_qtable.py\ (and \_write_json_atomic\ helper in \ ools/script_qtable.py\) verifying empty \--json\ refusal and atomic JSON write preservation on \ eplace_retry\ failure. ### Tested - \python -m compileall -q tools/script_qtable.py tests/test_script_qtable.py\ — exit 0. - \python -I tests/test_script_qtable.py\ — 15 tests (14 passed, 1 skipped; Windows 11 x64, Python 3.14.7). - \python -I scripts/check_no_game_data.py tools/script_qtable.py tests/test_script_qtable.py\ — exit 0. GPUs tested: n/a (CPU-only Python tool & unit tests) AI-assisted: yes ### Checklist - [x] Based on current \main\ and merges cleanly (a conflicting pull request is labeled \ eeds rebase\). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of \docs/design.md\, with how it was confirmed. (n/a — no translator change)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:14:30 +00:00
Author
Owner

@⁠MSedgeMC on GitHub · 2026-11-25 18:56 UTC · original · reviewed

Verified on the PR branch: the NEW test passes (python3 -m unittest tests.test_script_qtable.ScriptQtableTests.test_empty_json_rejected_and_atomic_write_preserves_existing -v -> 1 test OK), and the atomic-write change is the same sound staging+os.replace pattern used by the other probe tools. However the full branch suite is red: python3 -m unittest discover -s tests -p 'test_script_qtable*.py' -> 15 tests, 1 failure: test_symlinked_json_updates_target_in_place (os.path.islink(link_json) is False). That failing test is NOT on current main (it enters via older commits this branch carries, incl. merge of #1815), and main's own 10 tests pass. Please rebase onto current main and confirm the full suite is green before merge; I'm not approving a red branch.

**@⁠MSedgeMC** on GitHub · 2026-11-25 18:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2005#pullrequestreview-6063267849) · **reviewed** Verified on the PR branch: the NEW test passes (python3 -m unittest tests.test_script_qtable.ScriptQtableTests.test_empty_json_rejected_and_atomic_write_preserves_existing -v -> 1 test OK), and the atomic-write change is the same sound staging+os.replace pattern used by the other probe tools. However the full branch suite is red: python3 -m unittest discover -s tests -p 'test_script_qtable*.py' -> 15 tests, 1 failure: test_symlinked_json_updates_target_in_place (os.path.islink(link_json) is False). That failing test is NOT on current main (it enters via older commits this branch carries, incl. merge of #1815), and main's own 10 tests pass. Please rebase onto current main and confirm the full suite is green before merge; I'm not approving a red branch.
Author
Owner

@⁠Ch1mpleo on GitHub · 2026-11-25 19:37 UTC · original

Thanks @⁠MSedgeMC — removed the duplicate _write_json_atomic\ that shadowed the symlink-preserving helper (\os.path.realpath\ + \published_mode). Re-verified: \python -I tests/test_script_qtable.py\ (15 tests: 14 passed, 1 symlink test skipped on Windows).

**@⁠Ch1mpleo** on GitHub · 2026-11-25 19:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2005#issuecomment-7172557342) Thanks @⁠MSedgeMC — removed the duplicate \_write_json_atomic\ that shadowed the symlink-preserving helper (\os.path.realpath\ + \published_mode\). Re-verified: \python -I tests/test_script_qtable.py\ (15 tests: 14 passed, 1 symlink test skipped on Windows).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2005/head:github-bot/gh-2005'
git switch 'github-bot/gh-2005'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2005'
git switch 'github-bot/gh-2005'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2005'
git switch 'github-bot/gh-2005'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2005'
git switch 'main'
git merge --squash 'github-bot/gh-2005'
git switch 'main'
git merge --ff-only 'github-bot/gh-2005'
git switch 'main'
git merge 'github-bot/gh-2005'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.