fix: keep the smoke runner alive when jupyter is missing - #133
Merged
Conversation
execute_notebook shelled out to a bare `jupyter` argv with no FileNotFoundError guard, so on a machine without jupyter the exception escaped main(): the run died with a raw traceback at the first notebook entry, printed no `=== Smoke test summary ===` line, and left every remaining entry silently uncovered. The script leg was never affected -- it invokes sys.executable, which always exists. That is a contract break, not just a missing optional tool: the runner is documented (module docstring, workspace AGENTS.md) to continue through failures and always end with the summary line. CI never saw it because the runner images always ship jupyter, so it only bit a local sweep -- where it looked like a crash and quietly discarded coverage. Catch FileNotFoundError and report the entry as a failure with exit 127 and an actionable message. The check in run_notebook sits before the is_clean_skip_exit branch so an absent executor can never be laundered into a PASS, and it skips the regenerate-and-retry, which cannot help when the executor itself is missing. The guard nests inside the existing try/finally, so the staged notebook copy and temp dir are still cleaned up. Verified with jupyter absent: every entry runs and is counted, notebook entries report [FAIL (exit 127)], the summary line prints, and the runner exits non-zero. With a stub jupyter that exits 3 the runner still reports 3 and still retries, so the normal path is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LWj2zyGu6ptvqTS8drWhaJ
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.
Sibling of PyAutoLabs/autolens_workspace#471 — tracking issue PyAutoLabs/autolens_workspace#470. Identical patch.
What changed
.github/scripts/run_smoke.py::execute_notebookshelled out to a barejupyterargv with noFileNotFoundErrorguard. On a machine without jupyter the exception escapedmain(): the run died with a raw traceback at the first notebook entry, printed no=== Smoke test summary ===line, and left every remaining entry silently uncovered. The script leg was never affected — it invokessys.executable, which always exists.That is a contract break, not just a missing optional tool: the runner is documented (module docstring, and this repo's
AGENTS.md) to continue through failures and always end with the summary line. CI never saw it because the runner images always ship jupyter, so it only bit a local sweep — where it looked like a crash and quietly discarded coverage.The fix catches
FileNotFoundErrorand reports the entry as a failure with exit 127 and an actionable message. Three details worth review attention:try/finally, so the staged notebook copy and temp dir are still cleaned up.run_notebook's early return sits before theis_clean_skip_exitbranch, so an absent executor can never be laundered into a PASS.Scope
Only three of the 10
run_smoke.pycopies carry the notebook leg — this repo,autogalaxy_workspace,autolens_workspace. The other seven have noexecute_notebookat all and cannot hit this bug. The identical patch went into all three; this repo andautolens_workspacewere byte-identical before and remain so.Consolidating the copies is deliberately not done here — it is owned by a separate PyAutoMind prompt, re-scoped in the same session after measurement showed its premise was stale. Full rationale in PyAutoLabs/autolens_workspace#471.
Verification
jupyter is genuinely absent in the session container, so the original traceback was reproduced first, then the real runner re-run: exit 1, both notebook entries
[FAIL (exit 127)]with an actionable message, all 10 entries executed and counted, summary line printed, no escaped traceback. Normal path confirmed unchanged with a stubjupyterexiting 3 — reported 3, not 127, and still retried.Caveat: the PyAuto libraries are not installed in that container, so every script entry also failed on
ImportError. Unrelated to this change — and it is the ideal evidence, since it exercises the continue-through-failures path the fix defends. Not evidence that those scripts are broken; CI has the libraries and is the real check.Scripts Changed
None —
scripts/is untouched, so no notebook regeneration is needed. Only.github/scripts/run_smoke.pychanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01LWj2zyGu6ptvqTS8drWhaJ
Generated by Claude Code