Repository navigation
refactor(llc/adapters/tests): hoist shared adapter test helpers into conftest fixtures (#9844) - #9990
Merged
Merged
Conversation
…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>
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Applied Black, isort, and autoflake to match code-quality checks. Triggered by workflow auto-fix-formatting.yml. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
After #9834 moved the subprocess lifecycle into
SubprocessLifecycleAdapter, the per-adapter test modules still carried copy-pasted_agent_cfg/_make_fake_prochelpers and three sets of duplicated lifecycle test classes that asserted only inherited base behavior. Helpers hoisted to a newconftest.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
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; duplicatedTestStatus/TestTimeoutConfiguration/TestGracefulTimeoutclasses removedtest_subprocess_base.py—TestSharedStatus(5),TestSharedGracefulTimeout(2),TestResolveTimeout+1 precedence testTest count 119 → 105: 22 removed duplicates → 8 shared equivalents, mapping documented per-class. Zero production changes (verified: diff outside tests/ is empty).
Verification
llc/adapters/tests(reviewer re-ran independently)status()/cancel()/timeout resolution unchanged; adapter-specific survivors (test_cancel_clears_redis_session,test_cancel_removes_state_file, command/env tests) intactModel Used
Fable 5 (main session) + Sonnet sub-agents (implementation + independent review)
Fixes #9844
🤖 Generated with Claude Code