Skip to content

test(dry-run): drop repeated guards and twin cases #4731

Closed

Description

@dan-petty

Problem or Motivation

  • 41 cases of test_request_plan_flag_order_global_dry_run repeat the local case of each command, and only generic resolver lines differ (67.4 s in a local full run with per-test coverage contexts).
  • 15 'removed from gaps' tests repeat the ratchet invariant (0.8 s).
  • 11 dry-run files repeat a subprocess block that the session floor already applies (tests/conftest.py:444).
  • The dry-run test family has 3.70% duplicate lines (pylint symilar, -d 8).

Saving: About 19 s of CI worker time (estimated) and less test code.

Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.

Proposed Solution & Architectural Design

  • In tests/commands/test_global_dry_run.py, test the root --dry-run through the resolver on a table of argv shapes: options with values, positionals and --. Drop the per-command twins.
  • Delete the gaps tests whose list equals their class table, and keep the review prefix rule.
  • Make one tests/support fixture for the network block of dry runs only, and delete the subprocess blocks.

Risk: Medium. The per-command case was the only check that the resolver walks the argv of each command.

Target Subsystem

SDLC, Git & PR Governance (tests/commands/test_global_dry_run.py, tests/commands/test_ai_*_dry_run.py, tests/support/).

Existing Tool Considered

pytest parametrize. pylint symilar measures the duplicate share. No new tool. Cost: about 40,000 tokens and 3 hours.

Acceptance Criteria

  • The twin cases are gone, and the resolver table covers the given argv shapes.
  • The share of duplicate lines in the dry-run test family (pylint symilar, -d 8) is 1% or less (from 3.70%).

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: none. The title has the scope dry-run, and .github/labels.yml declares no scope/dry-run label. Add the label to the file to give the scope to this item.
    • Priority: P3-Low. Saves about 19 s of CI time and reduces test code, but no user-facing behaviour changes.
    • Value: Medium. Reduces CI queue wait and maintenance burden for the dry-run test family.
    • Effort: Medium. Requires rewriting 41 twin cases into a parametrized table, deleting 15 ratchet tests, and adding one shared fixture across 11 files.
    • Related: feat(cli): each command declares its dry-run class, and a ratchet test stops a new command without one #2230, which asks for a different change. Both concern the dry-run ratchet invariant, but #2230 adds the ratchet mechanism while the candidate removes 15 redundant tests that repeat it.
  3. added
    priority/p3-low
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 11, 2026
  4. removed
    status/in-progress
    owner/agent
    on Nov 12, 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

    effort/mediumpriority/p3-lowsource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions