Skip to content

test(infra): infrastructure tests run on edge fakes #1335

Closed
6 of 6 issues completed
Closed

Description

@dan-petty

Problem or Motivation

This item is the tracker of Phase E for the infrastructure and planning packages. It moves their tests onto the shared edge fakes. It also moves the in-memory roadmap store out of src and moves domain logic out of commands/.

The first body of this item was written on 2026-10-07. It named 40 test files for one pull request. That scope is too big, and part of it is void. Refine set needs-split. The evidence comment of 2026-11-05 proposed 3 items. This rewrite measures again at origin/main 29309f0 and splits the work into 6 children. Each child is one reviewable pull request.

Counting rules, used by every child:

  • A patch site is one call of patch, patch.object, patch.dict, monkeypatch.setattr, monkeypatch.setitem or monkeypatch.delattr, whatever its target. monkeypatch.setenv and monkeypatch.chdir are no patch sites.
  • A seam site is a patch site whose target is a socket or httpx2 name. The DNS and HTTP seams of refactor(cli): Unify HTTP and DNS seams with shared fakes #1314 replace seam sites.
  • A private import is a from devops_cli... import _name in a test file.
  • A scan is an AST pass over the files of a child. Each pull request comment gives the counts before and after.

Measured facts at 29309f0:

  • 26 of the 40 named files remain. They hold 26,761 lines and 1,101 tests. They hold 266 patch sites (26 of them seam sites) and 42 private imports. The count of 150 sites in the evidence comment came from another method.
  • InMemoryRoadmapStore sits in roadmap/memory_store.py (779 lines). 96 test-side files import it: 90 test modules, 5 modules of tests/support/ and tests/roadmap_faults.py. The class name appears 1,684 times in them. In src, only roadmap/duplicate_eval.py:32 imports it.
  • 8 patch sites replace get_roadmap_store: 3 in tests/support/roadmap.py (lines 35 and 63, and the one in unreadable_github_roadmap) and 5 in tests.
  • tests/roadmap_faults.py holds StoppingStore (2 users) and ListingStore (1 user). tests/roadmap_github_fake.py (GitHubFake, the gh process edge) has 9 importers and sits outside tests/support/fakes/.
  • The Q19 logic is still in commands/:
    • PromQL calls (commands/prometheus.py:174, 240, 330, 398, 453).
    • Cloudflare record matching (commands/cloudflare.py:438-505).
    • Grafana dashboard calls (commands/grafana.py:289-350).
    • Argo workflow waiting (commands/argo.py:134) and the Argo CD client (commands/argo.py:179-208).
    • Trace-span resolution (commands/sandbox.py:821).

Criteria of the old body that are void now:

Old criterion Why it is void
Sandbox mock detection is gone Done. sandbox/host.py holds no _is_mock_subprocess. #2149 (closed) owns the process fake for it.
bwrap live tests in the default run Replaced by the rule of 2026-10-24. #2149 (closed) and #1337 (closed) own it.
Four direct getaddrinfo calls go through the DNS seam The calls are gone. sandbox/models.py:270, 299 and valkey/client.py:52 call vet_addresses.
No inline LLMClient( in roadmap/ Done by #1001 (closed).
BoardServer folds into the session fake tests/roadmap_board_fake.py is gone. tests/project_board_fake.py tests github/projects.py, and no roadmap code reaches it (ADR 0016). It stays.
Ratchet ceilings drop by the removals #1309 closed as not planned. #1336 turns the counts into bans.
Hypothesis tests for RESP parsing valkey/protocol.py and cache/ are gone.
Move the store to tests/support/fakes/ Still true. The old body did not see the duplicate_eval coupling. Child 1 removes it first.
Valkey and Cloudflare client resolution moves to the package Dropped. Each one only turns settings and a keyring secret into a client. That is wiring. The Valkey fake (#1317) and the HTTP fake (#1314) reach the client behind it.
14 named files are gone They no longer exist. Three are test_pipeline_engine.py, test_cache_tiered.py and test_valkey_concurrency.py. Two are test_release_* files. Nine are test_roadmap_* files: board_read, close, config, document, lifecycle_properties, migrate, quota, render, reprioritize.

Proposed Solution & Architectural Design

Close this tracker when its 6 children are closed. This tracker has no code of its own.

The children and their order

# Child Blocked by
1 refactor(roadmap): the in-memory store leaves src, intake's evaluation reads a seeded roadmap, and the fault mode replaces StoppingStore none
2 test(roadmap): roadmap and ci tests take their store through one install hook and use no internal patch child 1
3 test(roadmap): the four largest roadmap test files split by behaviour child 2
4 test(sandbox): sandbox tests run on the process, Docker and OTLP fakes, and span resolution leaves commands/ none
5 test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes, and Argo waiting and Cloudflare matching leave commands/ none
6 test(infra): Argo CD, PromQL and Grafana run on the HTTP fake, and their API calls leave commands/ #1314 (proposed, see below)

Children 1 to 3 touch the same test files, so they land in this order. Children 4 and 5 touch files that no other child touches. They run in parallel with children 1 to 3.

Why #1314 blocks only child 6

Done when

  • All 6 children are closed.
  • In the 26 remaining named files, no private import remains. No patch site remains except the 16 seam sites of children 2 and 4. test(cli): Convert ratchets to bans and merge invariant tests #1336 then turns this into a ban.
  • git grep -n -E "memory_store|roadmap_faults" -- src tests finds nothing.
  • uv run devops ci passes.

Found while measuring (not in scope)

The command test files of #1327 (closed, PR #2872) still patch devops_cli names at 29309f0. tests/commands/test_valkey.py patches commands.valkey._resolve_client 22 times. tests/commands/test_cloudflare_commands.py patches commands.cloudflare.load_settings 20 times and _resolve_client 15 times. #1336 will fail on them. A person decides whether to reopen #1327 or file a new item. This tracker does not take that work. Child 5 and child 6 move only the cases that test the moved rule.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

pytest and Hypothesis stay the runner and the property-test tool. Both are open and maintained. They give no fake for the edges of this repository, so the fakes in tests/support/fakes/ stay the way to double an edge (ADR 0007).

The tracker builds nothing. Each child names its own tool and cost.

Strategic alignment

Proposed design

Problem statement

Phase E moves infrastructure and planning package tests onto the shared edge fakes. This tracker has no code of its own. It coordinates six child items that each fit one pull request. It closes when all six children close, the final scans find no forbidden reference, and uv run devops ci passes.

Acceptance criteria

Requirement: No private imports

The 26 remaining named test files SHALL hold no private import from devops_cli.

Scenario: Private import scan

  • WHEN An AST scan runs over the 26 named test files.
  • THEN It finds zero private imports.

Requirement: Patch sites limited to seams

The 26 remaining named test files SHALL hold no patch site other than the 16 seam sites of children 2 and 4.

Scenario: Patch site scan

  • WHEN An AST scan runs over the 26 named test files.
  • THEN It finds no patch site other than the 16 seam sites.

Requirement: Store references removed

The repository SHALL hold no reference to memory_store or roadmap_faults in src or tests.

Scenario: Store reference scan

  • WHEN git grep -n -E "memory_store|roadmap_faults" -- src tests runs.
  • THEN It finds nothing.

Requirement: Full gate passes

The repository SHALL pass uv run devops ci.

Scenario: Full gate

  • WHEN uv run devops ci runs on the final child merge.
  • THEN It exits with code 0.

Existing Tool Considered

No alternatives check has run. pytest and Hypothesis stay the runner and the property-test tool. Both are open and maintained. They give no fake for the edges of this repository, so the fakes in tests/support/fakes/ stay the way to double an edge (ADR 0007). The tracker builds no code, so it has no build cost.

Key questions

None.

Fit

Needs splitting into 6 items:

    1. refactor(roadmap): the in-memory store leaves src, intake's evaluation reads a seeded roadmap, and the fault mode replaces StoppingStore; blocked by none.
    1. test(roadmap): roadmap and ci tests take their store through one install hook and use no internal patch; blocked by child 1.
    1. test(roadmap): the four largest roadmap test files split by behaviour; blocked by child 2.
    1. test(sandbox): sandbox tests run on the process, Docker and OTLP fakes, and span resolution leaves commands/; blocked by none.
    1. test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes, and Argo waiting and Cloudflare matching leave commands/; blocked by none.
    1. test(infra): Argo CD, PromQL and Grafana run on the HTTP fake, and their API calls leave commands/; blocked by refactor(cli): Unify HTTP and DNS seams with shared fakes #1314.

Suspected block

None.

Dependencies

#1314

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added
    type/test
    priority/p2-medium
    scope/infra
    scope/ci
    scope/release
    on Oct 7, 2026
  2. 24 remaining items

  3. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    The proposal at dc9815e needs splitting into 6 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

      1. refactor(roadmap): the in-memory store leaves src, intake's evaluation reads a seeded roadmap, and the fault mode replaces StoppingStore; blocked by none.
      1. test(roadmap): roadmap and ci tests take their store through one install hook and use no internal patch; blocked by child 1.
      1. test(roadmap): the four largest roadmap test files split by behaviour; blocked by child 2.
      1. test(sandbox): sandbox tests run on the process, Docker and OTLP fakes, and span resolution leaves commands/; blocked by none.
      1. test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes, and Argo waiting and Cloudflare matching leave commands/; blocked by none.
      1. test(infra): Argo CD, PromQL and Grafana run on the HTTP fake, and their API calls leave commands/; blocked by refactor(cli): Unify HTTP and DNS seams with shared fakes #1314.
  4. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 9, 2026
  5. removed
    status/in-review
    on Nov 9, 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/p1-highscope/ciscope/infrascope/releasetype/testvalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions