Skip to content

refactor(llc/adapters/tests): hoist shared adapter test helpers into conftest fixtures (#9844) - #9990

Merged
mrveiss merged 3 commits into
Dev_new_guifrom
issue-9844
Jun 11, 2026
Merged

mrveiss merged 3 commits into
Dev_new_guifrom
issue-9844

Conversation

@mrveiss

@mrveiss mrveiss commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Thinking Path

After #9834 moved the subprocess lifecycle into SubprocessLifecycleAdapter, the per-adapter test modules still carried copy-pasted _agent_cfg/_make_fake_proc helpers and three sets of duplicated lifecycle test classes that asserted only inherited base behavior. Helpers hoisted to a new conftest.py; duplicated lifecycle tests replaced by shared ones against the base class. Adapter-specific coverage (command assembly, env, redis cleanup, state-file paths) stays in each adapter's module untouched.

What Changed

  • NEW llc/adapters/tests/conftest.py — agent_cfg(), make_fake_proc() (byte-identical to the three removed private copies)
  • test_claude_code_adapter.py, test_copilot_local_adapter.py, test_subscription_adapters.py — local helper defs removed; duplicated TestStatus/TestTimeoutConfiguration/TestGracefulTimeout classes removed
  • test_subprocess_base.py — TestSharedStatus (5), TestSharedGracefulTimeout (2), TestResolveTimeout +1 precedence test

Test count 119 → 105: 22 removed duplicates → 8 shared equivalents, mapping documented per-class. Zero production changes (verified: diff outside tests/ is empty).

Verification

  • 105/105 llc/adapters/tests (reviewer re-ran independently)
  • Independent coverage-focused review verdict APPROVE: every removed assertion has a verbatim shared equivalent; both adapters confirmed to inherit status()/cancel()/timeout resolution unchanged; adapter-specific survivors (test_cancel_clears_redis_session, test_cancel_removes_state_file, command/env tests) intact
  • flake8 + py_compile clean

Model Used

Fable 5 (main session) + Sonnet sub-agents (implementation + independent review)

Fixes #9844

🤖 Generated with Claude Code

…conftest fixtures (#9844)

- Add llc/adapters/tests/conftest.py with agent_cfg() and make_fake_proc()
  helpers (replaces identical private defs in claude, copilot, and subscription
  test modules).
- Move TestStatus (5), TestTimeoutConfiguration (4+1 precedence), and
  TestGracefulTimeout (2) from both adapter files into test_subprocess_base.py
  as TestSharedStatus / TestResolveTimeout / TestSharedGracefulTimeout — all
  three suites test SubprocessLifecycleAdapter base-class behaviour that is
  inherited unchanged by every concrete adapter.
- Retain adapter-specific assertions in each adapter file: command assembly,
  env injection, allowed-tools flag, Redis session clear (claude), GitHub token
  + copilot model env vars + workspace cwd (copilot), FD close, and retry logic.
- Remove unused imports (signal, LLCRunStatus) from adapter files after
  duplicate tests moved.

Duplicate removal mapping (22 removed → 8 consolidated):
  TestStatus x2 (10) → TestSharedStatus (5) in test_subprocess_base.py
  TestTimeoutConfiguration x2 (8) → TestResolveTimeout +1 precedence (4 total)
  TestGracefulTimeout x2 (4) → TestSharedGracefulTimeout (2)
Before: 119 tests. After: 105 tests. Coverage unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

github-actions Bot and others added 2 commits June 11, 2026 16:11
Applied Black, isort, and autoflake to match code-quality checks.
Triggered by workflow auto-fix-formatting.yml.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant