Skip to content

tests(bink_index): expect the KB2 refusal wording on a junk file (#7871) - #7914

Closed
ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:fix/bink-index-error-text
Closed

ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:fix/bink-index-error-text

Conversation

@ray3242

@ray3242 ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claim: #7804 (comment) (issue #7871).

What and why

tests/test_bink_index.py::test_a_single_named_file_that_is_not_a_stream_or_rpf_is_refused failed on current main: it expected not a Bink 2 stream or an RPF archive, but a junk first-four-bytes file is refused earlier by target_problem() (tools/bink_index.py:347) with the more precise not a Bink 2 stream (KB2) or an RPF archive. The second wording at line 399 is only for a file whose header looked valid but yielded no streams. The test was asserting the wrong path's message, leaving this named suite permanently red and masking real regressions.

The fix updates the assertion to the actual one-line reason and adds a comment recording why the two wordings differ. The tool is unchanged; the refusal exit code (2), the "no Traceback" check and the no-output-file check are all still asserted by the same test.

Tested

Windows 11, CPython 3.12.10, CPU only:

  • python -I -m unittest discover -s tests -p test_bink_index.py → Ran 32 tests ... OK (was 1 failure before the change).
  • python -m compileall -q make_game.py tools tests → exit 0.
  • git diff --check → exit 0.

No GPU used. This machine has an NVIDIA GeForce GTX 1060 6GB / driver 582.78, but no GPU test was needed. No game data, keys or decryption; the test writes its own junk file. AI-assisted (OpenCode).

Depends on: none.

@TieruYT

TieruYT commented Nov 23, 2026

Copy link
Copy Markdown

Windows, Python 3.13.7, synthetic inputs. Tested df8385b and compared with 849d370.

I ran the full test_bink_index.py module on both revisions. The parent had one failure in 32 tests; all 32 passed after updating the assertion to match the KB2 diagnostic. This is a test expectation change. The junk-input case still checked exit 2 and absence of the output file.

AI-assisted verification · GPT-6.2 Astra Medium

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@TieruYT — thank you for the independent Windows / Python 3.13.7 check with the parent-vs-head control (32 tests: 1 failure on 849d3709, 32/32 on df8385bf). That confirms the change is only the test expectation; the exit-2 and no-output-file assertions are unchanged. Much appreciated. AI-assisted (OpenCode).

@RAINighty

Copy link
Copy Markdown

Tested df8385bfb merged with main dde82f27e (clean merge) on Windows 11 (10.0.26300), Python 3.13.15 (venv with the pinned tests/requirements.txt), with llvm-mc 21.1.8 (AMDGPU) and SPIRV-Tools v2026.4 on PATH: pass.

  • tests/test_bink_index.py with this PR: passes (Ran 32 tests in 0.074s, OK). On main: fails (Ran 32 tests in 0.068s, FAILED (failures=1)).
  • Test-only change: the failure it fixes is the one listed above for main.
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate: PR #7408 (opened 16:43Z, before my claim) already updates this exact test expectation, and @CourtyardGames verified on Windows/Python 3.14 that its hunk makes all 32 tests pass. My claim was made without checking open PRs by test file. No code from mine should land. Sorry for the duplicate. AI-assisted (OpenCode).

@ray3242 ray3242 closed this Nov 23, 2026
@azterixx

Copy link
Copy Markdown

checked: #7914 | with: python -I -m unittest discover -s tests -p test_bink_index.py | on: Debian 13, Intel i7-8700, CPython 3.13.5, head df8385b, CPU only | result: pass (32 tests; main@dde82f27e: Ran 32 tests FAILED (failures=1))

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested df8385bf on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main dde82f27: pass for the file it changes; one of the two related red tests remains

For whoever merges: #7092 and #7408 repair both files.

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.

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