Skip to content

test(roadmap): add the seams the serve and ci tests still lack #3885

Closed

Description

@dan-petty

Problem or Motivation

Part of #1335. The pull request for #3746 moved the roadmap and CI tests onto the store install hook and the shared fakes. Four patch sites and two CI cases stay, because each needs a seam that the tree does not have yet:

  • patch("uvicorn.run") twice in tests/roadmap/test_roadmap_run.py (test_service_wiring and test_the_service_that_serve_starts_reads_its_halt_and_budget_from_the_volume). devops serve --service starts the ASGI server with uvicorn.run. No seam lets a test see the app that it gets. tests/server/test_server.py patches the same name five times.
  • patch("devops_cli.roadmap.run.run_due_jobs") twice in the same file. One case (test_service_wiring) reads the lane tables and clone directories that the lane jobs of devops serve --service pass on. The other case (test_failure_isolation_and_cli_exit) reads how devops roadmap run --confirm prints a RoadmapRunError whose text holds Rich markup. The lane table has no injection point, and no real job fails with such a text.
  • devops ci --force with a matching cache entry has no test. The old test patched _run_all_checks_async. run_subprocess_async starts real child processes unless subprocess.run is patched (core/process.py), so no process fake answers the checks of devops ci (test(cli): Use edge fakes and real git; drop test rebind hooks #1333). A probe in a temporary tree started a real uv, and the floor refused it.
  • The warning that _try_save_ci_cache prints when the tree changed during a CI run (MESSAGES.ci.cache_tree_changed) has no test. The rule itself is tested through record_passing_run. The command glue needs the same async seam.

Proposed Solution & Architectural Design

  1. After test(cli): Use edge fakes and real git; drop test rebind hooks #1333 removes the async reroute, add two CLI tests of devops ci over the process fake and the git fake: --force skips a matching cache entry, and a tree that changes during a run prints the warning and leaves the cache file as it was.
  2. Add a server-start seam, with a fake and a contract test, that tests/server/test_server.py and tests/roadmap/test_roadmap_run.py both use. Remove the two uvicorn.run patches.
  3. Give the lane jobs a public way to be read, such as the lane table as data on the app state, so a test needs no run_due_jobs patch. Test the markup case with a real failing row of the due table.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

The ASGI server runs under uvicorn, which stays. Only the call that starts it needs a seam, in the pattern of install_exporter.

Source: #3746

Proposed design

Problem statement

The serve and roadmap tests still patch uvicorn.run and run_due_jobs because the tree has no seam to see the ASGI app or the lane job tables. The CI cache tests also wait on #1333. This issue adds a server-start seam, exposes lane metadata on the app state, and adds a table seam for the roadmap CLI. It defers the CI tests until #1333 lands.

Acceptance criteria

Requirement: Server start seam

The serve command SHALL start the ASGI server through an installable server starter.

Scenario: Fake starter records the service start

  • WHEN A test installs a fake server starter and runs devops serve --service.
  • THEN The fake records one start call with the app factory and the host, port and log config, and the test builds the app from the factory.

Requirement: Server start contract

The server start seam MUST have a contract test that runs the fake and the real uvicorn starter.

Scenario: Contract test starts uvicorn on a loopback port

  • WHEN The contract test runs each case over the fake and over the real starter.
  • THEN The fake records the same start arguments, and the real starter serves a request on a loopback port and stops.

Requirement: No uvicorn patch

The server tests SHALL use the fake server starter instead of patching uvicorn.run.

Scenario: No uvicorn.run patch in the server tests

  • WHEN A search runs over tests/server/test_server.py and tests/roadmap/test_roadmap_run.py.
  • THEN It finds no patch("uvicorn.run") call.

Requirement: Lane metadata on app state

The service app SHALL expose each lane's job table and clone directory on its state.

Scenario: Service wiring reads lane metadata

  • WHEN A test starts devops serve --service with the fake server starter and builds the app.
  • THEN app.state.lanes gives the status, triage and model lane tables and clone dirnames, and the tables equal the lane row constants.

Requirement: No run_due_jobs patch

The roadmap tests SHALL read the lane metadata and the CLI table instead of patching run_due_jobs.

Scenario: No run_due_jobs patch in the roadmap tests

  • WHEN A search runs over tests/roadmap/test_roadmap_run.py.
  • THEN It finds no patch("devops_cli.roadmap.run.run_due_jobs") call.

Requirement: Roadmap CLI table seam

The roadmap run command SHALL accept an optional due table for tests.

Scenario: Failing row drives the CLI error

  • WHEN A test calls the roadmap run command with a table whose intake row raises RoadmapRunError("Crash [bold red]markup[/bold red]", failed_jobs=("intake",)).
  • THEN The command exits 1 and its output contains the literal [bold red]markup[/bold red] text.

Existing Tool Considered

No alternatives check has run. The ASGI server is uvicorn, which stays; only the call that starts it needs a seam, in the pattern of install_exporter. The change builds its own test seam, not a replacement for a tool. Cost: about 1,500 tokens to add, about 300 tokens a year to keep, in less than one day.

Key questions

  • Which shape should the server-start seam take?: Add install_server_starter and remove_server_starter in src/devops_cli/server/start.py. The serve command calls the installed starter. A fake starter records the app factory and options. A contract test runs the fake and the real uvicorn starter. (best practice) [sources: docs/TESTING.md:198, src/devops_cli/telemetry/tracer.py, tests/support/fakes/otlp.py]
    • Chosen: Install hook with a protocol and fake. Matches install_exporter, keeps the source free of patch-shaped modules, and gives a contract test.
    • Rejected: Patch uvicorn.run in each test. ADR 0007 and docs/TESTING.md forbid a module shaped for patching.
    • Rejected: Pass a starter parameter through the CLI. Leaks a test detail into the command signature and every caller.
  • How should the lane jobs expose their tables and clone directories?: Store a LaneSpec for each lane on app.state.lanes, with the lane name, table and clone dirname. The service wiring test reads that mapping. (best practice) [sources: src/devops_cli/server/app.py, tests/roadmap/test_roadmap_run.py]
    • Chosen: App state mapping. The test already reads app.state.jobs and pause_until; data on app state is public and needs no patch.
    • Rejected: Module-level install hook for lane jobs. Adds global state and a reset for no gain.
    • Rejected: Keep patching run_due_jobs. The issue removes this patch site.
  • How should the roadmap CLI test get a failing due table?: Add a public run_roadmap_command(table=...) function in src/devops_cli/commands/roadmap.py. The Typer command calls it with no table. The test calls it with a stub table whose intake row raises the markup error. (best practice) [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/run.py]
    • Chosen: Public command function with a table parameter. Exercises the real error path and exit code with no global patch.
    • Rejected: Patch run_due_jobs in the CLI test. The issue removes this patch site.
    • Rejected: Test only an error formatter. Does not cover the command's exit code and output.
  • Can the devops ci --force and cache-warning tests run before test(cli): Use edge fakes and real git; drop test rebind hooks #1333 lands?: No. run_subprocess_async starts real child processes unless subprocess.run is patched, so the process fake cannot answer the checks of devops ci. A probe started a real uv, and the floor refused it. The CI part waits on test(cli): Use edge fakes and real git; drop test rebind hooks #1333 and is deferred. [sources: src/devops_cli/core/process.py, openspec/changes/archive/2026-11-07-3746-roadmap-tests-install-store-hook/proposal.md:36]
  • Does the ASGI server stay uvicorn?: Yes. uvicorn stays. The change adds a seam around the call that starts it, not a new server. [sources: src/devops_cli/commands/serve.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-08: not-applicable.
Class: test, no search.
Tool: none found.

Activity

  1. added
    source/agent
    on Nov 7, 2026
  2. added
    type/test
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  3. dan-petty commented on Nov 7, 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: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Test-infrastructure work that unblocks remaining test coverage but does not fix a user-facing defect.
    • Value: Medium. Removes fragile patches and enables reliable serve and CI test coverage for all contributors.
    • Effort: Medium. Four distinct seams with fakes and contract tests across server, lane jobs, CI process, and cache warning paths.
    • Related: test(cli): command tests patch no devops_cli names #3769, which asks for a different change. Both remove internal devops_cli patches from command tests; #3769 is the umbrella rule for all command tests, while the candidate adds the specific serve and CI seams that remain.
  4. added
    priority/p2-medium
    on Nov 7, 2026
  5. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  6. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at a6fff84 (see proposed design in issue body).

    Moved to new items: #4016.

  7. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: test. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

  8. added
    owner/service
    on Nov 17, 2026
  9. 34 remaining items

  10. added
    status/blocked
    on Nov 17, 2026
  11. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-implement-devops-cli-3885-c81462 ended: succeeded.
    Image digest: sha256:47b191971ac0f40357ab821d8b13fa5ae022b11beccd42ea859f629c94751c51

    The last lines of its log:

    # Implement plan for dan-petty/devops-cli
    
    ## To implement
    - #3885 test(roadmap): add the seams the serve and ci tests still lack: branch `test/3885-add-the-seams-the-serve-and`, pull request #6150
    Tool call: run_command, started: git status --short
    Tool call: run_command, started: git log --oneline -3
    Tool call: run_command, program git, ok.
    Tool call: run_command, program git, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Disk use of the home volume at the end of step Start the server of serve through the installed starter: 1.9 GB. Largest folders: worktree/.venv 1.5 GB, .data 223.1 MB, worktree/openspec 60.1 MB, .cache 51.7 MB, worktree/tests 31.5 MB, worktree/src 15.7 MB, worktree/docs 2.6 MB, worktree/k8s 2.3 MB.
    Disk use of the home volume at the end of step group 2: 1.9 GB. Largest folders: worktree/.venv 1.5 GB, .data 223.1 MB, worktree/openspec 60.1 MB, .cache 51.7 MB, worktree/tests 31.5 MB, worktree/src 15.7 MB, worktree/docs 2.6 MB, worktree/k8s 2.3 MB.
    Failure class provider. Action left: retry.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    
  12. removed
    owner/service
    on Nov 17, 2026
  13. added
    status/in-review
    and removed
    status/blocked
    on Nov 18, 2026
  14. removed
    status/in-review
    on Nov 18, 2026
  15. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-18 06:26 UTC

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/p2-mediumscope/roadmapsource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions