Skip to content

test(mcp): port project management tests to bm_project - #1961

Merged
phernandez merged 2 commits into
mainfrom
test/bm-project-legacy-port
Oct 29, 2026
Merged

phernandez merged 2 commits into
mainfrom
test/bm-project-legacy-port

Conversation

@phernandez

Copy link
Copy Markdown
Member

Project tests now call the tools we ship, bm_project and bm_project_delete, instead of the legacy list_memory_projects, create_memory_project and delete_project.

Tests

  • tests/mcp/test_tool_project_management.py is deleted. Its tests now live here:
  • test-int/mcp/test_project_management_integration.py is renamed to test_bm_project_integration.py. Three identical list tests are now one. The workspace-slug test uses set_workspace_provider instead of patching resolve_workspace_parameter.
  • test_tool_bm_project.py: the call to legacy delete_project is gone. The constrained-server test now also passes a workspace selector.
  • test_tool_json_output_modes.py: the project list/create test calls bm_project.
  • test_tool_contracts.py and tests/implementation_mcp.py no longer list the three legacy functions.

Dropped tests

  • The _merge_projects unit tests (empty, cloud-only, overlap), because the function is deleted (see below). The local-only case is covered by the local list tests.
  • The _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 through bm_project.
  • The tests that only checked that get_client received workspace=None when 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_projects is deleted. Its cloud arguments were always None: 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 dead cloud_list and cloud_ws_* locals.
  • The len(cloud_entries) == 1 shortcut in _select_attached_cloud_entry is deleted. Sorting one entry returns that entry anyway.
  • hasattr(old_project, "path") is deleted. ProjectItem always has a path.
  • The ALREADY_EXISTS refusal now suggests bm_project(command='create', ...).
  • The module docstring is updated.

tools/__init__.py no longer re-exports list_memory_projects, create_memory_project and delete_project. Cloud no longer imports them (basic-memory-cloud#2857). list_memory_projects stays in project_management, because bm_project and search across all projects (search.py) call it.

Coverage of project_management.py is 100% with the bm_project unit tests alone.

Verification

  • just fast-check
  • just 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

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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T16:45:22.766805Z 8b911c4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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]>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 8b911c4dd9

ℹ️ 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".

@phernandez
phernandez merged commit 7ccfdbc into main Oct 29, 2026
45 checks passed
@phernandez
phernandez deleted the test/bm-project-legacy-port branch October 29, 2026 17:32
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