Skip to content

fix(testing): let the exit-code gate see fail() helpers and tuple returns - #426

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/exit-code-gate
Oct 5, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/exit-code-gate

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #360.

Problem

tests/check_exit_code_readme.py resolved only return N, sys.exit(N) and named constants. Most showcase checks are written as return fail("...", N), and many return tuples, so most codes went unguarded.

Change

  • Pass-through helpers: a module function whose every return hands back one of its own parameters (def fail(msg, code): …; return code) is treated as a pass-through. fail(msg, 15) and fail(msg, code=15) resolve to 15.
  • Tuple returns: these resolve through their first element: return 9, objs, objs, return fail(…), None, … and return (fail(…, 11),) + none3.
  • New tests/test_exit_code_readme.py (4 cases), added to Validate.

Evidence (local, no Blender)

  • The issue's probe: shipping_crate.py copied with its README rows 15–18 deleted.
    • Old checker: exit-code README checks passed.
    • New checker: return/exit 15|16|17|18 is not in the … exit table (4 errors).
  • Coverage: distinct non-zero codes the gate sees, summed over entry scripts, went from 559 to 2031. The README tables hold about 2,193 rows; the remainder are render-path or argparse codes documented by hand.
  • Full repo: still passes, so no undocumented code was hiding. This matches the review's scan.
  • test_exit_code_readme.py: 4/4 OK.

🤖 Generated with Claude Code

…urns

check_exit_code_readme.py resolved only `return N`, `sys.exit(N)` and
named constants, but most showcase checks return `fail("...", N)` and
many return tuples (`return 9, objs, objs`, `return (fail(...),) +
none3`). Deleting README rows 15-18 from shipping-crate passed the gate.

A module function whose every return hands back one of its own
parameters is now a pass-through helper, so `fail(msg, 15)` resolves to
15 (positional or keyword), and a tuple return resolves through its
first element. Distinct codes the gate guards across scripts: 559 ->
2031. No current README drift surfaced. tests/test_exit_code_readme.py
pins each shape and runs in Validate.

Closes #360

Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci label Oct 5, 2026
@TMHSDigital

Copy link
Copy Markdown
Owner Author

CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 143 passed, 1 skipped, 0 failed;142 passed, 0 skipped, 0 failed;141 passed, 3 skipped, 0 failed;136 passed, 6 skipped, 0 failed;

@TMHSDigital
TMHSDigital merged commit f454d51 into main Oct 5, 2026
13 checks passed
@TMHSDigital
TMHSDigital deleted the fix/exit-code-gate branch October 5, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

testing: exit-code README gate can't see return fail(msg, N) or tuple returns, so most codes are unguarded (#325 incomplete)

1 participant