From ebc0ffe4f341154d1902f9afe86f0a87f150179c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 21 Aug 2026 22:06:30 +0200 Subject: [PATCH] Make MCP config test portable --- epiphany-tool-mcp-runtime/src/config.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/epiphany-tool-mcp-runtime/src/config.rs b/epiphany-tool-mcp-runtime/src/config.rs index 90a6ea64..d1f29e93 100644 --- a/epiphany-tool-mcp-runtime/src/config.rs +++ b/epiphany-tool-mcp-runtime/src/config.rs @@ -191,12 +191,18 @@ impl McpServerConfig { mod tests { use super::*; + #[cfg(windows)] + const ABSOLUTE_COMMAND: &str = "C:/mcp/server.exe"; + #[cfg(not(windows))] + const ABSOLUTE_COMMAND: &str = "/usr/local/bin/mcp-server"; + #[test] fn parses_only_the_owned_stdio_and_http_subset() -> Result<()> { let config = McpRuntimeConfig::from_toml( - r#" + &format!( + r#" [mcp_servers.local] -command = "C:/mcp/server.exe" +command = "{ABSOLUTE_COMMAND}" args = ["--stdio"] startup_timeout_sec = 2 @@ -204,7 +210,8 @@ startup_timeout_sec = 2 url = "https://example.test/mcp" bearer_token_env_var = "MCP_TOKEN" tool_timeout_sec = 4 -"#, +"# + ), )?; assert!(matches!( config.server("local")?.transport,