refactor(test): remove Robot Framework imports from Behave mock library #706

Closed
freemo wants to merge 3 commits from refactor/m3-remove-robot-mock-imports into master
Owner
No description provided.
freemo added this to the v3.2.0 milestone 2026-03-12 00:51:06 +00:00
refactor(test): remove mock LLM providers from Robot Framework integration tests
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 17s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 28s
CI / security (pull_request) Successful in 42s
CI / typecheck (pull_request) Successful in 44s
CI / unit_tests (pull_request) Successful in 3m28s
CI / docker (pull_request) Successful in 43s
CI / integration_tests (pull_request) Failing after 5m11s
CI / coverage (pull_request) Successful in 5m35s
CI / benchmark-regression (pull_request) Successful in 37m43s
50134682b4
Replaced MockAIProvider and FakeListLLM with real LLM provider calls
(ChatAnthropic/ChatOpenAI) in 5 Robot Framework files. Test assertions
updated to handle non-deterministic LLM responses by verifying structure
and completion rather than exact content.

LLM model used: ChatAnthropic(model="claude-3-haiku-20240307") — chosen
as the fastest and cheapest Anthropic model for integration testing.

Files modified:
- robot/database_integration.robot: Replaced MockAIProvider() with
  ProviderRegistry.create_ai_provider(provider_type="anthropic") in
  End-To-End Database Workflow and Create Plan With Service keyword.
- robot/helper_plan_generation.py: Replaced FakeListLLM with ChatAnthropic.
- robot/plan_generation_graph.robot: Replaced FakeListLLM in all 18 test
  cases with ChatAnthropic. Tests verify graph structure, node presence,
  state shape, and workflow completion rather than exact LLM output.
- robot/context_analysis_agent.robot: Replaced FakeListLLM in 2 inline
  test scripts with ChatAnthropic.
- robot/helper_context_analysis.py: Replaced all 5 FakeListLLM sites with
  a shared _create_llm() factory returning ChatAnthropic.

Additional fix:
- src/cleveragents/application/services/plan_service.py: Wrapped the
  provider name/model_id setter calls in try/except to handle read-only
  properties on real LangChainChatProvider implementations (bug exposed
  by removing MockAIProvider which had mutable name/model_id setters).

Assertion strategy: All tests continue to verify structural correctness
(state keys, node names, type checks) and successful workflow completion.
No exact-string assertions on LLM output content.

ISSUES CLOSED: #698
refactor(test): remove Robot Framework imports from Behave mock library
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 37s
CI / typecheck (pull_request) Successful in 42s
CI / unit_tests (pull_request) Successful in 2m50s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Failing after 3m36s
CI / coverage (pull_request) Successful in 5m43s
CI / benchmark-regression (pull_request) Successful in 35m16s
d9fbea293c
Replaced cross-framework imports from features/mocks/ in 5 Robot Framework
helper files with real implementations or robot/-local stubs.

- robot/database_integration.robot: MockAIProvider already removed by #698
- robot/helper_uko_indexer.py: replaced InMemoryContentReader import with
  robot/_testing_stubs.InMemoryContentReader (identical implementation)
- robot/helper_lsp_stub.py: replaced parse_lsp_responses import with
  robot/_testing_stubs.parse_lsp_responses (identical implementation)
- robot/helper_skill_refresh.py: replaced MockMCPTransport import with
  robot/_testing_stubs.MockMCPTransport (identical implementation)
- robot/helper_mcp_adapter.py: replaced MockMCPTransport import with
  robot/_testing_stubs.MockMCPTransport (identical implementation)

ISSUES CLOSED: #700
refactor(test): replace mock test doubles with real MCP transport and dependencies
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 21s
CI / typecheck (pull_request) Successful in 45s
CI / security (pull_request) Successful in 59s
CI / unit_tests (pull_request) Successful in 2m45s
CI / integration_tests (pull_request) Successful in 3m24s
CI / docker (pull_request) Successful in 41s
CI / coverage (pull_request) Successful in 6m25s
CI / benchmark-regression (pull_request) Successful in 35m23s
7d38ea8b5d
Implemented real StdioMCPTransport for MCP server communication via
stdio subprocess with JSON-RPC framing. Created mcp_echo_server.py
fixture providing echo and add tools for integration tests.

Replaced InMemoryContentReader with real LocationContentReader backed
by temporary files. Replaced MockMCPTransport with real StdioMCPTransport
connecting to the fixture MCP server. Renamed _testing_stubs.py to
_test_utils.py (retaining only the pure parse_lsp_responses utility).

Fixed MCPToolAdapter.invoke() to handle real MCP content list responses.
Added env-gating for LLM integration tests (llm-required tag excluded
when ANTHROPIC_API_KEY is absent).

Closes #724
Author
Owner

PM Status: Closing as Stale

The content of this PR was pushed directly to master by @freemo in commit d9fbea29 (2026-03-12 00:50 UTC) and 7d38ea8b (2026-03-12 05:01 UTC), bypassing the PR review workflow. The work for issue #700 is complete on master.

This PR is now redundant — its content is already on master. Closing as stale.

Per CONTRIBUTING.md, all changes should go through PR review before merge.

## PM Status: Closing as Stale The content of this PR was pushed directly to master by @freemo in commit `d9fbea29` (2026-03-12 00:50 UTC) and `7d38ea8b` (2026-03-12 05:01 UTC), bypassing the PR review workflow. The work for issue #700 is complete on master. This PR is now redundant — its content is already on master. Closing as stale. Per CONTRIBUTING.md, all changes should go through PR review before merge.
freemo closed this pull request 2026-03-12 20:19:01 +00:00
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
Required
Details
CI / build (pull_request) Successful in 18s
Required
Details
CI / quality (pull_request) Successful in 21s
Required
Details
CI / typecheck (pull_request) Successful in 45s
Required
Details
CI / security (pull_request) Successful in 59s
Required
Details
CI / unit_tests (pull_request) Successful in 2m45s
Required
Details
CI / integration_tests (pull_request) Successful in 3m24s
Required
Details
CI / docker (pull_request) Successful in 41s
Required
Details
CI / coverage (pull_request) Successful in 6m25s
Required
Details
CI / benchmark-regression (pull_request) Successful in 35m23s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core!706
No description provided.