Skip to content

tests/test_gamedata_blobs: match exit 2 and ERROR: prefix for missing input after #6701 - #7646

Open
alexwlsnr wants to merge 1 commit into
ItsNotRexed:mainfrom
alexwlsnr:fix/test-gamedata-blobs-exit2
Open

alexwlsnr wants to merge 1 commit into
ItsNotRexed:mainfrom
alexwlsnr:fix/test-gamedata-blobs-exit2

Conversation

@alexwlsnr

Copy link
Copy Markdown

Claimed in the coordination issue as: #7496 (comment)

What and why

#6701 (22037f702) updated tools/gamedata_blobs.py so a missing input prints ERROR: cannot read <target>: no such file or folder and exits 2 (matching tests/test_missing_input_exit_codes.py), but left tests/test_gamedata_blobs.py (BadCarveIndexTest.test_missing_file_names_what_is_wrong) asserting exit code 1 and an error: prefix. As a result, tests/test_gamedata_blobs.py is currently failing on main:

FAIL: test_missing_file_names_what_is_wrong (__main__.BadCarveIndexTest.test_missing_file_names_what_is_wrong)
AssertionError: 2 != 1 : ERROR: cannot read /tmp/.../nope.rpf: no such file or folder

This PR adds optional returncode and prefix parameters to BadCarveIndexTest.assert_one_error (defaulting to 1 and "error:" so the four bad-carve-index tests keep checking the try/except path unchanged) and updates test_missing_file_names_what_is_wrong to expect returncode=2 and prefix="ERROR:".

Note: open PR #7005 was an earlier competing multi-tool BUILD-1046 PR that now conflicts with #6701; this PR is a focused single-file fix to turn tests/test_gamedata_blobs.py green on main.

Tested

Linux, Python 3.14.10 (CPU only, synthetic tests, no game data):

  • Before (55ba30c2a): python3 -I tests/test_gamedata_blobs.py — 6 passed, 1 failed (test_missing_file_names_what_is_wrong: AssertionError: 2 != 1).
  • After (b3216e804):
    • python3 -I tests/test_gamedata_blobs.py -v — 7 passed, 0 failed.
    • python3 -I tests/test_missing_input_exit_codes.py -v — 2 passed, 0 failed.
    • python3 -I tests/test_ci_registration.py — 14 passed, 0 failed.
    • python3 -m compileall -q tests/test_gamedata_blobs.py tools/gamedata_blobs.py — exit 0.
    • git diff --check — clean.

AI-assisted: yes (Antigravity)

Checklist

  • 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: test-only change, no translator change)

@azterixx

Copy link
Copy Markdown

checked: #7646 | with: python -I -m unittest discover -s tests -p test_gamedata_blobs.py | on: macOS 27.2.1, Apple M1 Pro, CPython 3.15.2, head b3216e8, CPU only | result: pass (7 tests); the same file fails 1 test on main@dde82f27e, so the PR fixes it

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested b3216e8 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 bf85ff7, 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_blobs.py: main 1 failed (test_missing_file_names_what_is_wrong), 6 passed; with the PR 7 passed.

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

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested b3216e80 on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main dde82f27: pass

  • python -I tests/test_gamedata_blobs.py: 7 tests OK (red on main: 1 failure, the test expected exit 1 where the tool returns 2 with an ERROR: line).
  • Test-only change; its absence is main.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047.

@airp1ane

Copy link
Copy Markdown
Contributor

Tested b3216e8 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass.

Ran the test files this PR adds or changes, from a clean checkout of the PR head: test_gamedata_blobs.py - all exit 0.

AI-assisted (Claude Code).

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.

5 participants