Skip to content

test(roadmap): install the roadmap store through one hook - #3889

Merged
dan-petty merged 14 commits into
mainfrom
test/3746-roadmap-tests-install-store-hook
Nov 7, 2026
Merged

dan-petty merged 14 commits into
mainfrom
test/3746-roadmap-tests-install-store-hook

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Roadmap and CI tests put their fakes in through one hook, not through a patch of a module attribute.

roadmap/store.py gets install_roadmap_store(factory) and reset_roadmap_store(), in the pattern of install_exporter. This is the only change in src: the tests are the rest. get_roadmap_store returns the installed store, else the GitHub store. The floor resets the hook after each test. A test that opens the real store now fails because the floor refuses gh.

ci/cache.py gets record_passing_run, so the rule "record a passing run only if the tree did not change" has a public function that a test calls.

The roadmap and CI tests use the process, web, model and store fakes, the cli fixture and make_item. They hold no private import. GitHubFake moves to tests/support/fakes/github_repository.py.

Four patch sites and two CI cases stay for want of a seam: see #3885.

Closes #3746

Change: openspec/changes/archive/2026-11-07-3746-roadmap-tests-install-store-hook/

get_roadmap_store opens the store that install_roadmap_store set, else the GitHub store. The floor calls reset_roadmap_store after each test. The roadmap_store fixture, the refine tests and the GitHub store tests use the hook, and the refine tests use no patch.
The intake and dry-run tests fail writes through the store fault mode, answer gh with the process fake, the model with the model fake, MCP calls with a dispatcher and telemetry with the OTLP fake. They patch no devops-cli name.
The run tests answer gh through GitHubFake.install on the process fake, log the Service in through the web fake, and fail reads through the store fault mode. They read the due rows through the table and import no private adapter.
record_passing_run holds the rule that a run is recorded only when the tree did not change while it ran. The cache tests read the fingerprint through the git fake and patch no devops-cli name.
The OpenSpec change 3746 plans the item. TESTING.md names the install hook, the read faults and the repository fake.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 7, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record for this pull request.

AST scan of the nine files of #3746 (patch sites and private imports of devops_cli):

  • Before: 73 patch sites, 7 private imports.
  • After: 9 patch sites, 0 private imports. 5 are the seam sites of test_roadmap_dry_runs.py that the DNS and HTTP seams replace later. 4 are in test_roadmap_run.py (2 uvicorn.run, 2 run_due_jobs).
  • No CliRunner() and no direct Item( remain in the nine files. They use the cli fixture and make_item.

Parts of #3746 that stay open, with the evidence:

Behavior found: through main.app, an exported DEVOPS_CLI_DRY_RUN becomes the --dry-run flag, so devops roadmap <job> --confirm is refused as two modes. The old tests called the sub-command directly and expected a dry run. The two tests are renamed and now assert the refusal and zero requests.

Focused runs: tests/roadmap and tests/ci pass (dry runs 47, with intake, refine, run, store contract and GitHub store 700+).
The full uv run devops ci runs now on the final tree. Its result follows in a later comment.

@dan-petty

Copy link
Copy Markdown
Owner Author

Full uv run devops ci on the final tree (after the rebase onto origin/main and the archive commit): exit 0. pytest and coverage passed in 10 minutes 30 seconds.

This corrects the "Focused runs" line of my first comment: the full run, not a subset, is the record.

On GitHub, Runner Image and Service Image fail on CVE-2026-78661 (golang.org/x/net v0.60.0, HIGH). The pull request changes no image input. Issue #3881 tracks the fix, and I added this pull request to it.

@dan-petty
dan-petty marked this pull request as ready for review November 7, 2026 04:17
@dan-petty
dan-petty enabled auto-merge (squash) November 7, 2026 05:10
@dan-petty
dan-petty force-pushed the test/3746-roadmap-tests-install-store-hook branch from 4ad7e2d to 5a0f3e0 Compare November 7, 2026 05:44
@dan-petty
dan-petty force-pushed the test/3746-roadmap-tests-install-store-hook branch from 5a0f3e0 to 4ad7e2d Compare November 7, 2026 05:44
@dan-petty
dan-petty merged commit bdee642 into main Nov 7, 2026
24 checks passed
@dan-petty
dan-petty deleted the test/3746-roadmap-tests-install-store-hook branch November 7, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(roadmap): roadmap tests take their store from one hook

1 participant