From 42959fa8d1f2487f261987b8542952a418d5a946 Mon Sep 17 00:00:00 2001 From: Will Pfleger Date: Sun, 12 Jul 2026 21:14:40 -0400 Subject: [PATCH] test(desktop): make MCP config path assertions portable Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/scripts/check-file-sizes.mjs | 3 ++- .../managed_agents/config_bridge/reader_tests.rs | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/desktop/scripts/check-file-sizes.mjs b/desktop/scripts/check-file-sizes.mjs index f8746b1d8b..2d59948983 100644 --- a/desktop/scripts/check-file-sizes.mjs +++ b/desktop/scripts/check-file-sizes.mjs @@ -198,7 +198,8 @@ const overrides = new Map([ // loginHint fields on AcpRuntimeCatalogEntry (+14 lines). Load-bearing new feature. // agent-lifecycle-fixes: GlobalAgentConfigSaveResult type grows with // failed_restart_count (+2 lines). Queued to split with the rest of this list. - ["src/shared/api/types.ts", 1030], + // mcp-readonly-view rebase: PR2 MCP config surface FE-type fields force +1 over the grandfathered ceiling. + ["src/shared/api/types.ts", 1031], // readiness-gate: PersonaDialog.tsx threads computeLocalModeGate + // requiredCredentialEnvKeys + RequiredFieldLabel so the "New agent" dialog // shows required markers and credential amber rows (parity with diff --git a/desktop/src-tauri/src/managed_agents/config_bridge/reader_tests.rs b/desktop/src-tauri/src/managed_agents/config_bridge/reader_tests.rs index 367168896a..b7829ff111 100644 --- a/desktop/src-tauri/src/managed_agents/config_bridge/reader_tests.rs +++ b/desktop/src-tauri/src/managed_agents/config_bridge/reader_tests.rs @@ -2,7 +2,7 @@ //! `reader.rs` stays under the 1000-line budget; `#[path]`-included from //! there). -use std::{collections::BTreeMap, sync::Mutex}; +use std::{collections::BTreeMap, path::Path, sync::Mutex}; use super::*; use crate::managed_agents::discovery::KnownAcpRuntime; @@ -142,8 +142,9 @@ fn surface_reports_mcp_specific_config_path() { .sources .mcp_config_file_path .expect("mcp config path"); + let expected_suffix = Path::new(".config").join("goose").join("config.yaml"); assert!( - path.ends_with(".config/goose/config.yaml"), + Path::new(&path).ends_with(&expected_suffix), "unexpected MCP config path: {path}" ); } @@ -156,9 +157,16 @@ fn goose_mcp_config_path_follows_path_root_override() { read_config_surface(&record, Some(runtime), None, None) }); + let expected_path = Path::new("/tmp/buzz-goose-root") + .join("config") + .join("config.yaml"); assert_eq!( - surface.sources.mcp_config_file_path.as_deref(), - Some("/tmp/buzz-goose-root/config/config.yaml") + surface + .sources + .mcp_config_file_path + .as_deref() + .map(Path::new), + Some(expected_path.as_path()) ); }