Skip to content

Commit 6687805

Browse files
committed
test(desktop): canonicalize Project connection fixture
Signed-off-by: KC <[email protected]> Signed-off-by: wolfyy970 <[email protected]>
1 parent 43fb782 commit 6687805

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎desktop/src-tauri/src/managed_agents/project_connections.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ static PROJECT_CONNECTIONS_LOCK: Mutex<()> = Mutex::new(());
3737
mod approval;
3838
mod credential_journal;
3939
mod transactions;
40-
#[cfg(test)]
41-
use approval::executable_sha256;
4240
use approval::{approved_execution_sha256, canonical_connection_command};
4341
use transactions::{commit_delete, commit_update, UpdateTransaction};
4442

‎desktop/src-tauri/src/managed_agents/project_connections/probe.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,15 @@ mod tests {
367367

368368
#[test]
369369
fn synthetic_server_proves_initialize_and_tool_discovery() {
370-
let node = super::super::super::resolve_command("node")
370+
let resolved_node = super::super::super::resolve_command("node")
371371
.expect("Hermit must provide Node for desktop tests");
372+
let (node, node_fingerprint) =
373+
canonical_connection_command(&resolved_node.to_string_lossy()).unwrap();
372374
let script = Path::new(env!("CARGO_MANIFEST_DIR"))
373375
.join("../tests/fixtures/synthetic-project-connection-mcp.mjs");
374376
assert!(script.is_file(), "missing fixture {}", script.display());
375377
let args = vec![script.to_string_lossy().to_string()];
376-
let executable_sha256 =
377-
approved_execution_sha256(&executable_sha256(&node).unwrap(), &args).unwrap();
378+
let executable_sha256 = approved_execution_sha256(&node_fingerprint, &args).unwrap();
378379
let connection = StoredProjectConnection {
379380
id: "synthetic-project-connection".to_string(),
380381
project_scope: ProjectConnectionScope {
@@ -385,7 +386,7 @@ mod tests {
385386
name: "Synthetic analytics".to_string(),
386387
provider: "Buzz test fixture".to_string(),
387388
capability_ids: Vec::new(),
388-
command: node.to_string_lossy().to_string(),
389+
command: node,
389390
args,
390391
env_keys: vec!["PROJECT_CONNECTION_CANARY".to_string()],
391392
discovered_tools: Vec::new(),

0 commit comments

Comments
 (0)