Skip to content

gamedata_index: stage --json so a write failure keeps the previous report - #8789

Open
Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/gamedata-index-preserve-json
Open

Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/gamedata-index-preserve-json

Conversation

@Grimkeh

@Grimkeh Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Claim: #8504 (comment)

Synthetic; no game files. AI-assisted (Cursor / Composer).

Test plan

  • python3 -I -m unittest discover -s tests -p test_gamedata_index.py — 33 OK

Made with Cursor

…port

Publish through a temp file + replace so a mid-write OSError leaves any prior complete JSON intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
@YordiLorenzo

Copy link
Copy Markdown

Tested 587d3ba on Linux, Python 3.14.4: pass

  • python -I tests/test_gamedata_index.py: 33 tests OK, same on 3.12
  • Negative control, write_json put back to a direct write: the new test fails, OSError not raised
  • After a failed replace only out.json is left in the folder, and a normal write after it publishes the new report

@sds-228 sds-228 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Focused suite passes 33/33 at this head; the new write-failure case fails against the pre-change source. The staged JSON publish preserves an existing complete report and retains the tool's output-mode checks.

AI-assisted (OpenCode).

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested 587d3ba on Windows 11 (CPU only, no GPU needed): pass

Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto main 867d922, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).

  • tests/test_gamedata_index.py: main 32 passed, 44 subtests passed; with the PR 33 passed, 44 subtests passed.

AI-assisted (Claude Code, Claude Opus 5.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants