refactor: collapse run_smoke.py onto the PyAutoHands runner (198 → 77 lines) - #16
Merged
Merged
Conversation
…7 lines) Phase 1 of PyAutoHands#260. This file was one of ten vendored copies of the same machinery across the workspace repos; it becomes a thin delegator over `autohands/run_python.py`, the shape the HowTo repos have used all along. The copies were not merely duplicated, they were EXPENSIVE. Each of the last three fixes had to be swept across every copy by hand: the env-resolver fork (PyAutoHands#185), the per-script timeout and process-group kill (#226/#227), and the jupyter guard. The HowTo tier needed none of those sweeps, precisely because it holds no logic. The blocker to collapsing was never behaviour but discovery model — the shared runner was opt-out (no_run.yaml) while this gate is opt-in (smoke_tests.txt) — and PyAutoHands#261 closed that with `--list`. Behaviour is preserved, verified rather than assumed: - Env resolution is IDENTICAL. The old runner passed a relative script path to build_env_for_script; the shared runner passes an absolute one. Every listed script was resolved both ways and diffed: 0 differences across all four repos (and 0 across the three user workspaces). Pattern matching is substring/stem based, so the path form does not matter, and no profile pattern can collide with the absolute prefix. - The per-script BUILD_SCRIPT_TIMEOUT cap and the process-group kill are the same implementation this file already imported from build_util. - No profile in this repo sets per-script `args`, so the shared runner's extra-args support changes nothing here. - Every entry in smoke_tests.txt resolves to a file that exists. `config/build/no_run.yaml` is deliberately NOT applied to the allowlist. It is policy for the release mega-run and notebook generation; smoke_tests.txt is policy for this gate, and a script legitimately appears in both. Honouring no_run here would have silently dropped 13 scripts across four repos from smoke coverage — measured, and fixed in PyAutoHands#262 before this landed. `--report-dir` is load-bearing: run_python.py only propagates failure when a report was built, so without it the gate would be vacuously green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UpSFum81Jeq9KZ9wdKtaeZ
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.
Summary
Phase 1 of PyAutoHands#260.
.github/scripts/run_smoke.pywas one of tenvendored copies of the same machinery across the workspace repos. It becomes a
thin delegator over
autohands/run_python.py— the shape the HowTo repos haveused all along.
The copies were not merely duplicated, they were expensive. Each of the last
three fixes had to be swept across every copy by hand: the env-resolver fork
(PyAutoHands#185), the per-script timeout and process-group kill (#226/#227),
and the jupyter guard. The HowTo tier needed none of those sweeps, precisely
because it holds no logic.
The blocker was never behaviour, it was discovery model — the shared runner
was opt-out (
no_run.yaml) while this gate is opt-in (smoke_tests.txt).PyAutoHands#261 closed that with
--list.This repo needed a second PyAutoHands fix
autocti_workspace_testis the only workspace with noconfig/build/no_run.yaml, and the autohands-level fallback path does not existeither. Both shared runners opened that file unconditionally, so the delegator
would have crashed with
FileNotFoundErrorbefore running a single script —once at module load and again in
parse_no_run_reasonsunder--report-dir.PyAutoHands#262 makes a missing
no_run.yamlnon-fatal under--list(withan allowlist there is nothing for it to filter), while discovery still requires
it, since a run with no exclusion policy is not a safe default. Verified against
exactly this repo's shape before this PR was written.
Behaviour preserved — verified, not assumed
path to
build_env_for_script; the shared runner passes an absolute one.All 3 listed scripts were resolved both ways and diffed: 0 differences.
build_util(timeout_for,kill_group).smoke_tests.txtresolves to a file that exists (3/3).--report-diris load-bearing:run_python.pyonly propagates failure when areport was built, so without it the gate would be vacuously green.
Test Plan
no_run.yamlshape run end-to-end: completes, writes its report,exits 0 all-green and 1 on a failure
Requires PyAutoHands#261 and #262, both merged.
Generated by the PyAutoLabs agent workflow.
Generated by Claude Code