Skip to content

test(review): scanner_fake answers the review scanners through the ToolExecutor fake, not through patched subprocess calls #1982

Closed

Description

@dan-petty

Friction

  • scanner_fake doubles shutil.which and subprocess.run. The review scanners now start their tools through a ToolExecutor, so the process edge has a seam. The fake still patches the standard library under that seam.

Evidence

Checked at main 4bb052c.

Existing tool considered

  • ToolExecutorFake is the shared fake of the review-tool edge (ADR 0007). This part reuses it and adds no second fake.

Proposed remedy

  • Rebuild scanner_fake over ToolExecutorFake. The fake answers each ToolRequest of a recorded scanner with the recorded exit code, standard output and standard error.
  • Keep the recordings in tests/fixtures/scanner_runs/recorded_runs.json and the contract suite tests/test_scanner_contract.py.
  • Remove the patches of shutil.which and subprocess.run from the fake.

Acceptance criteria

  • scanner_fake installs ToolExecutorFake and patches no shutil or subprocess name.
  • Every test that uses scanner_fake passes with the same recordings.
  • tests/test_scanner_contract.py still checks that each adapter makes the recorded command and reads the recorded run as it read the real run.
  • Tests run offline with fakes and recorded tool output: no network, no real scanner, no model. Each new test runs under 1 s.
  • uv run devops ci passes.

Source: #772

Activity

  1. added
    type/test
    source/agent
    on Oct 23, 2026
  2. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/test. The candidate changes test behavior and fake implementation.
    • Priority: P2-Medium. The change improves test reliability and maintainability.
    • Value: Medium. The change affects how tests run and their accuracy.
    • Effort: Medium. The change requires rebuilding a fake and updating tests.
  3. added a commit that references this issue on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/test

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions