Repository navigation
Make the GPU probe harness name the helper it failed to extract - #11538
Conversation
The harness builds a runnable block by sed-ing named functions out of studio/setup.sh. When setup.sh gains a helper and the selection block calls it, nothing here notices until the block runs with it undefined, and then every case that reaches the call dies on a bare "command not found". #11437 did exactly that with _amd_prefer_discrete_gfx: 8 passed, 29 failed, and not one of the 29 named the cause. #11472 added the helper to the sed lines and a named grep guard for it, which fixes that helper and only that helper. The next one repeats it. Give each extracted artifact a command_not_found_handle instead, so the first call that is actually reached says which function is missing and which sed line would supply it. Reached, not merely present: setup.sh arms this test never takes do call helpers it never extracts (the NVIDIA banner, the step/substep printers), so a static scan of the text reports those as defects when they are not. A static version of this guard failed the suite on all three.
|
@codex review |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…othai#11538) The harness builds a runnable block by sed-ing named functions out of studio/setup.sh. When setup.sh gains a helper and the selection block calls it, nothing here notices until the block runs with it undefined, and then every case that reaches the call dies on a bare "command not found". unslothai#11437 did exactly that with _amd_prefer_discrete_gfx: 8 passed, 29 failed, and not one of the 29 named the cause. unslothai#11472 added the helper to the sed lines and a named grep guard for it, which fixes that helper and only that helper. The next one repeats it. Give each extracted artifact a command_not_found_handle instead, so the first call that is actually reached says which function is missing and which sed line would supply it. Reached, not merely present: setup.sh arms this test never takes do call helpers it never extracts (the NVIDIA banner, the step/substep printers), so a static scan of the text reports those as defects when they are not. A static version of this guard failed the suite on all three.
tests/sh/test_setup_gpu_summary_probe_sources.shbuilds a runnable block bysed-ing named functions out ofstudio/setup.sh. Nothing in it notices whensetup.shgrows a helper that the selection block calls: the block just runs with that helper undefined, and every case reaching the call dies on a barecommand not found.That is not hypothetical. #11437 added
_amd_prefer_discrete_gfxand_amd_gfx_is_shadowing_integrated, called them from the selection block, and the harness never extracted them:Twenty-nine failures, each naming the symptom once, none naming the cause. It was red on every open PR that ran the shell suite until #11472 landed.
#11472 fixed it correctly: it added both helpers to the
sedlines and a namedgrepguard for each. But that covers those two helpers. The next helper added to the selection block reproduces the same wall of failures, because the guard list is exactly the list somebody already remembered to addsedlines for.The change
Give each extracted artifact a
command_not_found_handle, so the first call that is actually reached says what is missing and how to supply it:The existing named greps are kept. They state which helpers must be present today, which is worth saying explicitly; this catches the ones nobody thought to state.
Reached, not merely present
I first wrote this as a static scan of the extracted text for calls to
setup.shfunctions that the artifact does not define. That is the wrong check, and it failed the suite on three names that are not defects:_setup_nv_banner_fields,stepandsubstep. All three really are called from the extracted region and really are not extracted, but they sit in arms this test never takes, since the NVIDIA path is pinned false. Reachability is not decidable from the text, so the check has to run.Verification
37 passed, 0 failedon this file, unchanged from maintests/shstays green (test_setup_*: 18, 23, 13, 28, 15, 13, 37, 37 passed, plus the ALL PASSED ones)sedlines and removing the namedgrepguards so only the new handler can catch it, reports the function by name instead ofcommand not foundTests only, no behaviour change.