Repository navigation
fix(integration): trust unittest exit code, not 'tail -3 | grep ^OK' (false-fail seen on main today) - #443
Merged
Conversation
Pre-fix CI false-failed test_envelope when unittest emitted DeprecationWarning lines after the OK marker — output looked like: .................. ---------------------------------------------------------------------- Ran 18 tests in 0.246s OK /home/runner/.venv/.../resource_warning.py:N: ResourceWarning: ... `tail -3` captured the last 3 lines (the warning + blank + something), missed the OK marker, scenario_python_units called fail(). Joel hit this on main CI after promote — false-positive failure on a passing test. Two real bugs in one: 1. Output-parsing for pass detection is fragile against any post-OK noise (warnings, debug prints, etc.). Fix: trust unittest's exit code (0=pass, non-zero=fail). 2. Failure mode emitted only "✗ test_X" with no error context. Debugger can't act. Fix: capture stderr+stdout to tempfile, dump last 30 lines on failure so the actual traceback reaches CI logs. Both fixes together: false-pass impossible, true-fail actionable. Same pattern as airc's "evidence is for the debugger, not the trash" rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Joel pasted main CI showing test_envelope failing while it passed locally. Root cause: the python-units scenario greps the LAST 3 LINES of unittest output for '^OK'. CI's Python emits DeprecationWarning/ResourceWarning lines AFTER the OK marker → tail -3 misses OK → false-fail.
Two real bugs in one:
python3 test.pyreturns 0 on pass, non-zero on fail).Same pattern as airc's 'evidence is for the debugger, not the trash' rule. Same family as my recent jtag chat.log artifact upload (#1012) — make failures actually surface their cause.
🤖 Generated with Claude Code