tools/script_qtable: add empty --json and atomic write regression tests (SCRIPT-QTABLE-ATOMIC-JSON) #2005
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2005"
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 Ch1mpleo on 2026-11-25T17:57:18Z.
Claimed in the coordination issue as: SCRIPT-QTABLE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170215117)
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
GPUs tested: n/a (CPU-only Python tool & unit tests)
AI-assisted: yes
Checklist
eeds rebase).
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-25T18:56:18Z.
Review: COMMENTED
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.
Imported from ubiquitarianism/leonida. Originally posted by Ch1mpleo on 2026-11-25T19:37:45Z.
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).
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T10:11:37Z.
#2005 | head
34416c8c7de33c692df840519ff6e539a8e70e49|python3 -I tests/test_script_qtable.py -v| red: 15 passed | green: 15 passed | Green on both treesThis PR adds regression coverage. The transplanted test already passed against the implementation on current main.
Pinned main
33db04a7010e81c40a7a6a15624525aa0c4a3a58, merged into this PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:59:00Z.
Merged, thank you @Ch1mpleo! This PR (tools/script_qtable: add empty --json and atomic write regression tests (SCRIPT-QTABLE-ATOMIC-JSON)) was checked by zmasi or sodove and then by our own local run of its tests with main merged in, and it passed cleanly, so it went in with its reviewed batch.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.