You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gamedata_blobs: report a missing target as 'error:' with exit 1 - #8006
gamedata_blobs.py printed 'ERROR: ... no such file or folder' and exited 2 for a missing target, while every other failure in the tool prints 'error:' and exits 1 (and the test expects that). Aligned the missing-target path with the rest.
Reproduced a regression on 6c3a3121f (Windows 11, Python 3.12.10, CPU-only, no game files): reverting tools/gamedata_blobs.py from ERROR: / exit 2 back to error: / exit 1 makes tests/test_gamedata_blobs.py pass at the expense of breaking tests/test_missing_input_exit_codes.py.
Why
Commit 22037f702 (#6701, tools: missing inputs are one ERROR line and exit 2 in five more tools) intentionally changed missing-input exits in tools/gamedata_blobs.py:365-366 to ERROR: + exit 2 and pinned that contract in tests/test_missing_input_exit_codes.py:30, while tests/test_gamedata_blobs.py:290 (BadCarveIndexTest.test_missing_file_names_what_is_wrong, from #5948) still asserted exit 1 / error:.
Observed output on 6c3a3121f (the gamedata_blobs subtest passes on maindde82f27e and fails here):
FAIL: test_missing_input_is_exit_2_with_one_error_line (__main__.MissingInputExitCodeTests.test_missing_input_is_exit_2_with_one_error_line) (tool='gamedata_blobs')
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../tests/test_missing_input_exit_codes.py", line 52, in test_missing_input_is_exit_2_with_one_error_line
self.assertEqual(p.returncode, 2, p.stderr)
AssertionError: 1 != 2 : error: cannot read .../tests/no-such-input-for-build-1046: no such file or folder
Suggested fix
Keep tools/gamedata_blobs.py:365-366 returning exit 2 with ERROR: (preserving #6701 / tests/test_missing_input_exit_codes.py) and update tests/test_gamedata_blobs.py:290 to expect exit 2 and ERROR: for a missing target so both test suites pass together.
Confirmed on Windows 11 (CPython 3.14.3, CPU only, no game files).
Echoing @limpan1212's finding: changing tools/gamedata_blobs.py:365-366 from exit 2 (ERROR:) to exit 1 (error:) introduces a regression in tests/test_missing_input_exit_codes.py:
FAIL: test_missing_input_is_exit_2_with_one_error_line (tool='gamedata_blobs')
AssertionError: 1 != 2 : error: cannot read .../no-such-input-for-build-1046: no such file or folder
Commit 22037f702 (#6701, following BUILD-1046) standardized missing input paths across tools to output uppercase ERROR: and return exit code 2.
The proper fix is to leave tools/gamedata_blobs.py:365-366 as-is and instead update tests/test_gamedata_blobs.py:288-291 (test_missing_file_names_what_is_wrong) to expect exit code 2 and uppercase ERROR:, which brings both test suites into agreement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gamedata_blobs.py printed 'ERROR: ... no such file or folder' and exited 2 for a missing target, while every other failure in the tool prints 'error:' and exits 1 (and the test expects that). Aligned the missing-target path with the rest.
Tested: python -I tests/test_gamedata_blobs.py (7 tests) passes; python -m compileall -q tools/gamedata_blobs.py passes.
AI-assisted.