Skip to content

test(cli): migrate 49 tests to public interfaces #2167

Closed

Description

@dan-petty

What happened

#1307 splits the test migration into one child per package, and each child names the test files it owns. Files added after the census of 2026-10-07 have no owner. The test-suite audit of 2026-10-24 at df8e2ee found 49 test files that no child of #1307 names and that patch a devops_cli name or import a private one: 146 internal patch sites in 33 files and 50 private-name imports in 28 files.

File Internal patch sites Private-name imports
tests/test_k8s_ipv6_and_proxy_boundaries.py 15 9
tests/test_k8s_volume_reclaim.py 12 0
tests/test_k8s_gpu_placement.py 11 0
tests/ai/review/test_runner.py 6 4
tests/test_telemetry_llm_content.py 9 0
tests/test_ai_research_socratic.py 6 2
tests/test_rag_kb_sync.py 8 0
tests/test_review_group_analysis.py 7 1
tests/test_review_pipeline_go.py 3 5
tests/test_pr_hardening_report.py 7 0
tests/test_review_canary.py 6 0
tests/test_security_zizmor.py 6 0
tests/ai/review/test_pipeline.py 3 2
tests/commands/test_review_removed_options.py 5 0
tests/test_k8s_tempo.py 4 1
tests/llm_stream_fakes.py 4 0
tests/test_ai_research_mental_model.py 4 0
tests/test_fail_to_pass.py 4 0
tests/test_osv_scanner.py 2 2
tests/ci/test_cache_fuzzing.py 2 1
tests/core/test_cleanup_fuzzing.py 2 1
tests/test_ci_repeat.py 3 0
tests/test_config_field_validation.py 1 2
tests/test_golangci_lint_scanner.py 3 0
tests/test_review_rules_pack.py 2 1
tests/commands/test_pr.py 0 2
tests/test_ai_research_analogies.py 2 0
tests/test_architectural_invariants.py 0 2
tests/test_review_syntax_masking.py 0 2
tests/test_roadmap_return.py 2 0
tests/test_url_credential_masking.py 2 0
tests/ai/review/test_cited_code.py 1 0
tests/argo/test_gitops_fuzzing.py 0 1
tests/core/test_clock_contract.py 1 0
tests/test_ai_research_forage.py 0 1
tests/test_all_commands_help_dryrun.py 0 1
tests/test_ci_mutate.py 1 0
tests/test_cli_format_adoption.py 0 1
tests/test_cli_startup_imports.py 0 1
tests/test_codebase_hygiene_and_shims.py 0 1
tests/test_core_repo.py 1 0
tests/test_k8s_agents_manifests.py 0 1
tests/test_k8s_monitoring_alerting.py 0 1
tests/test_kb_manuals_metadata.py 0 1
tests/test_review_ruff_mypy_evidence.py 0 1
tests/test_review_tool_runs.py 0 1
tests/test_review_tool_sandbox.py 0 1
tests/test_stack_dashboards.py 0 1
tests/test_survey_cmd.py 1 0

Most of these files are new since 2026-10-07: for example tests/test_k8s_gpu_placement.py (2026-10-21), tests/test_telemetry_llm_content.py and tests/test_review_pipeline_go.py (2026-10-24). So the coupling that #1307 retires keeps growing in files that no item will migrate.

What should happen

Each file in the table tests through the public interface over the shared fakes, as docs/TESTING.md and ADR 0007 require. It patches no devops_cli name and imports no private name.

Evidence

Acceptance criteria

This item is a child of #1307 for the files that no other child names. A file that #1313 moves keeps its owner here. Follows ADR 0007 as #2143 amends it.

Source: #1307

Proposed design

Problem statement

49 test files added after the 2026-10-07 census patch devops_cli internal names or import private names. No child of #1307 owns them. They must test through public interfaces over shared fakes, as ADR 0007 and docs/TESTING.md require.

Acceptance criteria

  • Criterion 1: No test in the 49 files patches a devops_cli module, class, function, or attribute, or imports a name that starts with an underscore from devops_cli.
    Verification: Run a grep or static analysis over the 49 files for patch( calls targeting devops_cli names and for imports of names starting with _. The result is zero matches.
  • Criterion 2: Each test double is a shared fake from tests/support/fakes/, installed through its seam or fixture.
    Verification: Inspect the 49 files. Every mock or fake object comes from tests/support/fakes/ or a conftest fixture that installs one. No inline MagicMock replaces a devops_cli dependency.
  • Criterion 3: Product code that a test needed only for a patch is removed or made public, as test(cli): tests double only process edges and mirror the source tree #1307 Q27 specifies.
    Verification: For each removed patch site, confirm the product code it targeted is either deleted or exposed through a public seam. The pull request description names each such site.
  • Criterion 4: If test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 has landed, its ceilings are reduced by the number of sites this item removes.
    Verification: Check the test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 ceiling values in the repository. They are lower by the count of sites removed in this pull request.
  • Criterion 5: Each test still checks the behaviour it checked before. The pull request names each test it deletes and why.
    Verification: Diff the test function names before and after. Every deleted test is named in the pull request description with a reason.
  • Criterion 6: uv run devops ci passes.
    Verification: Run uv run devops ci in the pull request branch. All checks complete with a passing status.

Key questions

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#2143

Activity

  1. added
    type/test
    source/agent
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/test. The candidate is about updating tests to use public interfaces and shared fakes.
    • Priority: P2-Medium. This change improves test quality and maintainability but does not block other work.
    • Value: High. Improving test quality reduces coupling and makes the codebase easier to maintain.
    • Effort: High. Updating 49 test files to use public interfaces requires significant refactoring work.
    • Related: test(k8s): devops k8s commands are thin adapters tested over edge fakes, and the _K8sModule patch forwarding is gone #1323, which asks for a different change. Both items relate to test file updates, but #1323 focuses on k8s commands and edge fakes, while this candidate addresses general test file coupling issues.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

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

  4. added
    priority/p2-medium
    status/ready
    effort/high
    value/high
    scope/cli
    on Oct 28, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Staged: branch test/2167-the-49-test-files-that-no, draft pull request #2982. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. AI review runner: remove private imports and patch sites: 9751 tokens
    2. AI review pipeline: remove private imports and patch sites: 9750 tokens
    3. AI review cited code and removed options: 9754 tokens
    4. AI review pipeline go, group analysis, canary: 9723 tokens
    5. AI review rules pack, syntax masking, ruff/mypy evidence: 9733 tokens
    6. AI review tool runs and tool sandbox: 9693 tokens
    7. K8s IPv6/proxy boundaries and volume reclaim: 9758 tokens
    8. K8s GPU placement and tempo: 9736 tokens
    9. K8s agents manifests and monitoring alerting: 9722 tokens
    10. Telemetry LLM content and RAG KB sync: 9727 tokens
    11. Security zizmor, OSV scanner, golangci-lint scanner: 9776 tokens
    12. CI repeat, CI mutate, cache fuzzing: 9784 tokens
    13. Core cleanup fuzzing, clock contract, core repo: 9761 tokens
    14. Commands test_pr: remove set_delivered_status patch: 9711 tokens
    15. AI research: socratic, mental model, analogies, forage: 9823 tokens
    16. LLM stream fakes: remove private method patches: 9729 tokens
    17. Argo gitops fuzzing: remove private import: 9691 tokens
    18. Fail to pass, config field validation, PR hardening report: 9755 tokens
    19. Architectural invariants, roadmap return, URL credential masking: 9755 tokens
    20. All commands help dryrun, CLI format adoption, CLI startup imports: 9726 tokens
    21. Codebase hygiene, KB manuals metadata, stack dashboards, survey cmd: 9798 tokens

    These paths of the plan are no file on the default branch, and no group creates them: tests/test_review_pipeline_go.py, tests/test_review_group_analysis.py, tests/test_review_canary.py, tests/test_review_rules_pack.py, tests/test_review_syntax_masking.py, tests/test_review_ruff_mypy_evidence.py, tests/test_review_tool_runs.py, tests/test_review_tool_sandbox.py, tests/test_k8s_ipv6_and_proxy_boundaries.py, tests/test_k8s_volume_reclaim.py, tests/test_k8s_gpu_placement.py, tests/test_k8s_tempo.py, tests/test_k8s_agents_manifests.py, tests/test_k8s_monitoring_alerting.py, tests/test_telemetry_llm_content.py, tests/test_rag_kb_sync.py, tests/test_security_zizmor.py, tests/test_osv_scanner.py, tests/test_golangci_lint_scanner.py, tests/test_ci_repeat.py, tests/test_ci_mutate.py, tests/test_core_repo.py, tests/test_ai_research_socratic.py, tests/test_ai_research_mental_model.py, tests/test_ai_research_analogies.py, tests/test_ai_research_forage.py, tests/test_fail_to_pass.py, tests/test_config_field_validation.py, tests/test_pr_hardening_report.py, tests/test_architectural_invariants.py, tests/test_roadmap_return.py, tests/test_url_credential_masking.py, tests/test_all_commands_help_dryrun.py, tests/test_cli_format_adoption.py, tests/test_cli_startup_imports.py, tests/test_codebase_hygiene_and_shims.py, tests/test_kb_manuals_metadata.py, tests/test_stack_dashboards.py, tests/test_survey_cmd.py. A person checks that the plan names them right.

  6. added a commit that references this issue on Nov 1, 2026
  7. added
    status/planned
    and removed
    status/ready
    on Nov 1, 2026
  8. added a commit that references this issue on Nov 1, 2026
  9. changed the title [-]test(cli): the 49 test files that no child of #1307 names test through public interfaces over the shared fakes, with no internal patches or private imports[/-] [+]test(cli): migrate 49 tests to public interfaces[/+] on Nov 6, 2026
  10. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 144 characters, and the limit is 60. The type and the scope stay.

  11. added
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 6, 2026
  12. removed
    status/in-review
    on Nov 6, 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/highpriority/p2-mediumscope/clisource/agenttype/testvalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions