Skip to content

Commit bc088ca

Browse files
test(mcp): canonicalize temp profile roots
1 parent be5f955 commit bc088ca

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

tests/mcp_suite/fixture.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,10 @@ async fn build_template(dest: &Path) -> io::Result<()> {
273273
// repo's .git and bootstrap branch metadata that a TempDir-based test
274274
// project would never have.
275275
let scratch = tempfile::TempDir::new()?;
276+
let scratch_root = scratch.path().canonicalize()?;
276277

277278
for (flavor, indexed) in [(EMPTY_FLAVOR, false), (INDEXED_FLAVOR, true)] {
278-
let root = scratch.path().join(flavor);
279+
let root = scratch_root.join(flavor);
279280
let project = root.join("project");
280281
fs::create_dir_all(&project)?;
281282
if indexed {

tests/mcp_suite/mcp_dashboard_tool_test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use tempfile::TempDir;
1111
use tracedecay::mcp::handle_tool_call;
1212
use tracedecay::tracedecay::{TraceDecay, TraceDecayOpenOptions};
1313

14+
use crate::common::canonical_existing_path;
15+
1416
/// The dashboard manager is process-global (one dashboard per MCP server
1517
/// process), so these tests must not run concurrently: serialize them.
1618
static TEST_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(());
@@ -19,7 +21,7 @@ async fn setup_minimal_project() -> (TraceDecay, TempDir, TempDir) {
1921
let home = TempDir::new().unwrap();
2022
let dir = TempDir::new().unwrap();
2123
let project = dir.path();
22-
let profile_root = home.path().join(".tracedecay");
24+
let profile_root = canonical_existing_path(home.path()).join(".tracedecay");
2325
let open_options = TraceDecayOpenOptions {
2426
profile_root: Some(profile_root.clone()),
2527
global_db_path: Some(profile_root.join("global.db")),

tests/mcp_suite/multi_mcp_coordination_test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ use tempfile::tempdir;
33
use tracedecay::mcp::McpServer;
44
use tracedecay::tracedecay::{TraceDecay, TraceDecayOpenOptions};
55

6+
use crate::common::canonical_existing_path;
7+
68
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
79
async fn two_mcps_on_same_project_coordinate_via_sync_lock() {
810
let home = tempdir().unwrap();
911
let tmp = tempdir().unwrap();
1012
let project = tmp.path().to_path_buf();
11-
let profile_root = home.path().join(".tracedecay");
13+
let profile_root = canonical_existing_path(home.path()).join(".tracedecay");
1214
let open_options = TraceDecayOpenOptions {
1315
profile_root: Some(profile_root.clone()),
1416
global_db_path: Some(profile_root.join("global.db")),

0 commit comments

Comments
 (0)