Repository navigation
Description
Friction
tests/test_scanner_tool_executor.py has an autouse fixture of its own, scanners_installed, that patches shutil.which so that the review scanners look installed. docs/TESTING.md says that tests double only process edges, through the shared fakes. Since #1982, scanner_fake puts an executable stand-in for each recorded scanner first on PATH and patches no shutil or subprocess name.
What should happen
tests/test_scanner_tool_executor.py makes the scanners findable with stand-ins on PATH, as scanner_fake does, or with scanner_fake itself, and patches no shutil name.
Evidence
- Found during test(review): scanner_fake answers the review scanners through the ToolExecutor fake, not through patched subprocess calls #1982 on 2026-10-24: the fixture
scanners_installedintests/test_scanner_tool_executor.pypatchesshutil.which.
Order
After #1982.
Source: #1982
Proposed design
Problem statement
The test file tests/test_scanner_tool_executor.py makes review scanners appear installed by patching shutil.which. Since #1982, the shared scanner_fake fixture makes scanners findable by putting executable stand-ins on PATH and patches no shutil or subprocess name. The test file violates the convention in docs/TESTING.md that a test doubles only process edges through shared fakes. The fixture must be replaced with stand-ins on PATH so that no shutil name is patched.
Acceptance criteria
- Criterion 1: The autouse fixture scanners_installed no longer patches shutil.which.
Verification: Run grep -n 'shutil.which' tests/test_scanner_tool_executor.py and confirm no match. Run uv run pytest tests/test_scanner_tool_executor.py -x and confirm all tests pass. - Criterion 2: The scanners are made findable by placing executable stand-in files on PATH, as scanner_fake does.
Verification: Run uv run pytest tests/test_scanner_tool_executor.py -x -v and confirm all tests pass. Inspect the fixture and confirm it creates files in a temp directory and prepends that directory to PATH, with no monkeypatch.setattr on shutil. - Criterion 3: No test in the file patches a shutil or subprocess name.
Verification: Run grep -n 'monkeypatch.setattr.*shutil|monkeypatch.setattr.*subprocess' tests/test_scanner_tool_executor.py and confirm no match.
Key questions
- What does scanner_fake do to make scanners findable on PATH?: It puts an executable stand-in for each recorded scanner first on PATH. It patches no shutil or subprocess name. [sources: docs/TESTING.md:179, openspec/changes/archive/2026-10-24-1982-scanner-fake-through-tool-executor/design.md]
- Should the test use scanner_fake directly or create its own stand-ins on PATH?: The test uses tool_executor_fake (a plain ToolExecutorFake) in most cases, not scanner_fake (which carries recorded answers). The test needs only the PATH stand-ins so that shutil.which finds the tool. It should create its own stand-ins on PATH, the same mechanism scanner_fake uses internally, without requiring the recorded answers of scanner_fake. (proposed) [sources: tests/test_scanner_tool_executor.py:55, docs/TESTING.md:179]
- Is there a dependency on another issue?: Yes. The issue states it must come after test(review): scanner_fake answers the review scanners through the ToolExecutor fake, not through patched subprocess calls #1982, which rebuilt scanner_fake over ToolExecutorFake and established the stand-in-on-PATH pattern. [sources: openspec/changes/archive/2026-10-24-1982-scanner-fake-through-tool-executor/tasks.md:23]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate changes how tests are written, focusing on testing patterns.This improves test consistency and maintainability but does not block other work or introduce new features.The failed run 1982 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 on the board.Improves test reliability by aligning with established patterns used in other tests.Requires minimal changes to replace one patch with another approach using PATH stand-ins.dan-petty commentedon Oct 28, 2026
Status set to Ready at bb46660 (see proposed design in issue body).
devops-cli-service commentedon Nov 1, 2026
Staged: branch
test/2116-the-scanner-executor-tests-find-the, draft pull request #2977. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
These paths of the plan are no file on the default branch, and no group creates them:
tests/test_scanner_tool_executor.py. A person checks that the plan names them right.401 remaining items
devops-cli-service commentedon Nov 4, 2026
Stopped at push.
Failure class:
ci_infra.Action taken: none.
Action left:
retry: run the item again.Reason:
Last message of the agent (a claim that no check verified): none.
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service also clears the stop one time when a new runner image rolls out.devops-cli-service commentedon Nov 4, 2026
The runner Job devops-cli-runner-20261104-213648-3fbc ended: succeeded.
Image digest: sha256:ff7f81f8f5902c5ae4e48ed334bc83f842b51afb639ab71be65cb4240daadf01
The last lines of its log:
devops-cli-service commentedon Nov 4, 2026
Cleared the stop at push by the rule
digest: the runner image changed since the stop, from sha256:ff7f81f8f5902c5ae4e48ed334bc83f842b51afb639ab71be65cb4240daadf01 to sha256:e7f20c7f4265aecf32baeb064817eca07bffedc9fd3f31cdfd450a2d20e9abba. The item is Planned again, and the Service takes it in the next round. The Service clears a stop one time for each runner image. A new stop on this image waits for a commentimplement: retry.devops-cli-service commentedon Nov 4, 2026
Stopped at push.
Failure class:
ci_infra.Action taken: none.
Action left:
retry: run the item again.Reason:
Last message of the agent (a claim that no check verified): none.
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service also clears the stop one time when a new runner image rolls out.devops-cli-service commentedon Nov 4, 2026
The runner Job devops-cli-runner-20261104-220133-8bd9 ended: succeeded.
Image digest: sha256:e7f20c7f4265aecf32baeb064817eca07bffedc9fd3f31cdfd450a2d20e9abba
The last lines of its log:
devops-cli-service commentedon Nov 4, 2026
Cleared the stop at push by the rule
digest: the runner image changed since the stop, from sha256:e7f20c7f4265aecf32baeb064817eca07bffedc9fd3f31cdfd450a2d20e9abba to sha256:d36abcebefae7c845fd29aca7f7b5257ae4b219b58b3ff74d43ec1b0726dc508. The item is Planned again, and the Service takes it in the next round. The Service clears a stop one time for each runner image. A new stop on this image waits for a commentimplement: retry.devops-cli-service commentedon Nov 4, 2026
Stopped at push.
Failure class:
ci_infra.Action taken: none.
Action left:
retry: run the item again.Reason:
Last message of the agent (a claim that no check verified): none.
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service also clears the stop one time when a new runner image rolls out.devops-cli-service commentedon Nov 4, 2026
The runner Job devops-cli-runner-20261104-221949-b8f2 ended: succeeded.
Image digest: sha256:d36abcebefae7c845fd29aca7f7b5257ae4b219b58b3ff74d43ec1b0726dc508
The last lines of its log:
devops-cli-service commentedon Nov 4, 2026
Cleared the stop at push by the rule
digest: the runner image changed since the stop, from sha256:d36abcebefae7c845fd29aca7f7b5257ae4b219b58b3ff74d43ec1b0726dc508 to sha256:bf609edd0c01ca1c27bdc7e5d0f9e7385ff29934887b4e531bc648ef36301351, and the classci_infraof the stop is one that a new attempt can fix. The item is Planned again, and the Service takes it in the next round. The Service clears at most 1 for each class and 3 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a commentimplement: retry.dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 98 characters, and the limit is 60. The type and the scope stay.
test(review): the scanner executor tests find the scanners through stand-ins on PATH, not a patched shutil.whichtest(review): use PATH stand-ins for scanner tests