Skip to content

test(cli): pr, gh and repos tests patch no names - #4097

Merged
dan-petty merged 2 commits into
mainfrom
test/3769-pr-gh-repos-command-tests-on-edge-fakes
Nov 8, 2026
Merged

dan-petty merged 2 commits into
mainfrom
test/3769-pr-gh-repos-command-tests-on-edge-fakes

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The tests of the pr, gh and repos commands patched 266 names inside devops_cli. Each test now reaches its edge through a shared double: process_fake for gh and git, github_api for the GitHub session, roadmap_store, config, clock and mcp_dispatcher. A new helper, tests/support/gh_process.py, holds the gh answers that nine files repeated. Tests that called a private helper now run the command and read its output. Node ids and checked behavior stay the same, and no file under src/ changes.

The rule of docs/TESTING.md is that a test doubles only an edge. This change removes the patches that block the ban of #1336.

Closes #4085

Change: openspec/changes/archive/2026-11-07-4085-pr-gh-repos-command-tests-on-edge-fakes/

The tests of the pr, gh and repos commands patched 266 names inside
devops_cli. They now reach gh and git through the process fake, GitHub
through the session fake, the roadmap through the in-memory store, and
settings through the config fixture.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/cli Core CLI framework, Typer subcommands, options, and tables labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Results of the local runs.

  • Full uv run devops ci on the final code (before the rebase onto 3 new main commits): exit 0, every row passed. The test row took 20m 30s, over the 5-minute budget, on the loaded host. The slowest tests are in other groups (test_k8s_monitoring_alerting, test_ai_local_dry_run, roadmap job tests).
  • After the rebase: the nine migrated files, tests/invariants and tests/github/test_github_projects_reconcile.py give 1004 passed.
  • String patches of a devops_cli name in the nine files: 266 before, 0 after. Node ids match before and after.
  • Faults put into src made the migrated tests fail (list in the proposal, section Feasibility).

Left for a later item of #3769 (named in the proposal): four tests in tests/commands/test_repos.py still import private helpers of devops_cli.commands.repos. Review also noted that one gh test patches a method of the in-memory roadmap store, which is a fake and not a devops_cli name. A failure hook on the fake is optional.

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 00:17
@dan-petty
dan-petty merged commit 7fcddcd into main Nov 8, 2026
24 checks passed
@dan-petty
dan-petty deleted the test/3769-pr-gh-repos-command-tests-on-edge-fakes branch November 8, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/cli Core CLI framework, Typer subcommands, options, and tables type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cli): pr, gh and repos command tests patch no names

1 participant