From 040578ba1db6b63fece78022ada4d448129958b6 Mon Sep 17 00:00:00 2001 From: Qing Date: Wed, 4 Nov 2026 23:54:26 +0800 Subject: [PATCH] test(host): keep the ignore fixtures clear of a machine global excludes (#1279) The rpc integration test wrote *.tmp fixtures; a machine whose global excludes file lists *.tmp already ignores them, so the backend never writes the .gitignore / info/exclude entry and the test failed reading it. The fixtures now use a suffix no excludes file lists. Co-authored-by: qtvbwfn <5848026+qtvbwfn@users.noreply.github.com> --- crates/ide-host/tests/rpc.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/ide-host/tests/rpc.rs b/crates/ide-host/tests/rpc.rs index fa0551082..6e5460954 100644 --- a/crates/ide-host/tests/rpc.rs +++ b/crates/ide-host/tests/rpc.rs @@ -228,7 +228,9 @@ async fn serves_projects_files_documents_search_and_runs() { // Real project-host ignore writes travel through the remote command dispatcher. assert!(Dispatcher::standard().commands().contains(&"vcs_add_to_ignore")); let ignore_root = dunce::canonicalize(&project).unwrap(); - for (name, destination) in [("shared.tmp", "gitignore"), ("private.tmp", "localExclude")] { + // Not `.tmp`: a machine's global excludes file (often `*.tmp`) already + // ignores those, so the backend never writes the entry anywhere. + for (name, destination) in [("shared.ignore-me", "gitignore"), ("private.ignore-me", "localExclude")] { let path = ignore_root.join(name); std::fs::write(&path, "temporary").unwrap(); invoke(&peer, "vcs_add_to_ignore", json!({ "paths": [path], "destination": destination })).await.unwrap(); @@ -237,9 +239,9 @@ async fn serves_projects_files_documents_search_and_runs() { assert_eq!(entry["ignored"], true); assert_eq!(entry["excluded"], false); } - assert!(std::fs::read_to_string(project.join(".gitignore")).unwrap().contains("/shared.tmp")); - assert!(std::fs::read_to_string(project.join(".git/info/exclude")).unwrap().contains("/private.tmp")); - let outside = tmp.path().join("outside.tmp"); + assert!(std::fs::read_to_string(project.join(".gitignore")).unwrap().contains("/shared.ignore-me")); + assert!(std::fs::read_to_string(project.join(".git/info/exclude")).unwrap().contains("/private.ignore-me")); + let outside = tmp.path().join("outside.ignore-me"); std::fs::write(&outside, "keep").unwrap(); assert!( invoke(&peer, "vcs_add_to_ignore", json!({ "paths": [outside], "destination": "gitignore" })).await.is_err()