From fcff8e3de4a8d48383c17e677aa848aa515ffb7f Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Mon, 23 Mar 2026 00:05:52 -0400 Subject: [PATCH] =?UTF-8?q?tests:=20fix=20test=20collision=20=E2=80=94=20u?= =?UTF-8?q?se=20unique=20DB=20name=20+=20cleanup=20in=20dep=5Fsearch=20tes?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dep_search_explicit_dep_project_name created nonexistent.db via resolve_store → cbm_store_open_path(SQLITE_OPEN_CREATE), causing tool_delete_project_not_found to find the file and return "deleted" instead of "not_found". Fix: use unique name "_tc_deptest_proj_" + unlink cleanup after test. 2178 tests passing. Signed-off-by: Andrew Hundt --- tests/test_tool_consolidation.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_tool_consolidation.c b/tests/test_tool_consolidation.c index a22f30048..ad16c0ed4 100644 --- a/tests/test_tool_consolidation.c +++ b/tests/test_tool_consolidation.c @@ -869,10 +869,16 @@ TEST(resource_status_returns_not_indexed_when_no_store) { TEST(dep_search_explicit_dep_project_name) { cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL); ASSERT_NOT_NULL(srv); + /* Use unique name to avoid creating DB files that interfere with other tests */ char *r = cbm_mcp_handle_tool(srv, "search_graph", - "{\"project\":\"nonexistent.dep.pandas\",\"name_pattern\":\".*\",\"limit\":1}"); + "{\"project\":\"_tc_deptest_proj_.dep.pandas\",\"name_pattern\":\".*\",\"limit\":1}"); ASSERT_NOT_NULL(r); free(r); + /* Clean up any DB file that resolve_store may have created */ + char path[1024]; + snprintf(path, sizeof(path), "%s/.cache/codebase-memory-mcp/_tc_deptest_proj_.db", + getenv("HOME")); + (void)unlink(path); cbm_mcp_server_free(srv); PASS(); }