Repository navigation
test(mcp): port project management tests to bm_project - #1961
Conversation
Project tests now call bm_project and bm_project_delete instead of list_memory_projects, create_memory_project and delete_project. - Local behavior runs against the real API in test_tool_bm_project.py. - Cloud behavior runs in test_tool_bm_project_cloud.py against an in-memory Cloud injected through set_client_factory and set_workspace_provider, the seams the Cloud server uses. Stdio with credentials replaces get_cloud_proxy_client, the network boundary. - project_management drops _merge_projects (its cloud arguments were always None; _merge_workspace_projects gives the same local rows), a redundant single-entry shortcut, and a hasattr guard. The same-name-other-path refusal now suggests bm_project. - tools/__init__.py no longer re-exports the three legacy functions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6515165043
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The Windows platform job still listed the deleted test_tool_project_management.py and test_project_management_integration.py. It now runs the files that hold those tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <[email protected]>
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Project tests now call the tools we ship,
bm_projectandbm_project_delete, instead of the legacylist_memory_projects,create_memory_projectanddelete_project.Tests
tests/mcp/test_tool_project_management.pyis deleted. Its tests now live here:tests/mcp/test_tool_bm_project.pyand runs against the real API. Covered: list text, constrained list (text and JSON), create withset_default, delete that keeps files,delete_notes=true, idempotent repeat create, the retry that indexes a project created without indexing (built through the real API, not a mocked index failure), the same-name-other-path refusal (create_memory_project reports success for an existing name with a different path #1811, text and JSON), workspace without credentials fails fast (create_memory_project silently drops workspace selector on local MCP server (OAuth-only), creates project locally #954), and explicit--localoverriding a workspace selector.tests/mcp/test_tool_bm_project_cloud.py. An in-memory Cloud is served overhttpx.MockTransportand injected throughset_client_factoryandset_workspace_provider, the seams the Cloud server itself uses. Covered: listing grouped by workspace,display_name, workspace JSON metadata, a discovery failure being returned to the caller, each spelling of the project constraint (Honor project constraints in JSON project-list tool output #1895), create by workspace slug with background indexing, a hosted retry that skips the path check, a create answer missing the project, a Cloud delete always deleting files (Always delete cloud files on cloud project remove; keep local sync deletion opt-in #1597), eachfile_delete_status, and an unknown workspace refused asINVALID_ARGUMENTS.async_client.get_cloud_proxy_clientwithmonkeypatch, because that function is the network client and has no injection seam. This is the one monkeypatch beyond environment variables.test-int/mcp/test_project_management_integration.pyis renamed totest_bm_project_integration.py. Three identical list tests are now one. The workspace-slug test usesset_workspace_providerinstead of patchingresolve_workspace_parameter.test_tool_bm_project.py: the call to legacydelete_projectis gone. The constrained-server test now also passes a workspace selector.test_tool_json_output_modes.py: the project list/create test callsbm_project.test_tool_contracts.pyandtests/implementation_mcp.pyno longer list the three legacy functions.Dropped tests
_merge_projectsunit tests (empty, cloud-only, overlap), because the function is deleted (see below). The local-only case is covered by the local list tests._routes_to_cloud"explicit--cloud" assertion. With explicit cloud routing and no factory, the request leaves through the real cloud proxy. The explicit-local branch is covered throughbm_project.get_clientreceivedworkspace=Nonewhen no workspace was given. Local create/delete and the Cloud default-workspace cases cover the same behavior.Source
project_management.py, 136 lines removed:_merge_projectsis deleted. Its cloud arguments were alwaysNone: the cloud list it took was never fetched, so it only formatted local rows._merge_workspace_projects(local, (), config)produces the same rows. With it go the deadcloud_listandcloud_ws_*locals.len(cloud_entries) == 1shortcut in_select_attached_cloud_entryis deleted. Sorting one entry returns that entry anyway.hasattr(old_project, "path")is deleted.ProjectItemalways has apath.bm_project(command='create', ...).tools/__init__.pyno longer re-exportslist_memory_projects,create_memory_projectanddelete_project. Cloud no longer imports them (basic-memory-cloud#2857).list_memory_projectsstays inproject_management, becausebm_projectand search across all projects (search.py) call it.Coverage of
project_management.pyis 100% with the bm_project unit tests alone.Verification
just fast-checkjust test-unit-sqlite -k "test_tool_bm_project or test_tool_contracts or test_tool_json_output_modes or ..."just test-unit-sqlite -k "test_tool_search or test_v1_registration or test_tool_read_note or test_project_context or test_async_client_modes"just test-unit-postgres -k "test_tool_bm_project or test_tool_json_output_modes or test_tool_contracts"just test-int-sqlite -k "test_bm_project_integration or test_output_format_json or test_single_project"🤖 Generated with Claude Code
https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8