mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai> Co-authored-by: M3gA-Mind <elvin@tinyhumans.ai> Co-authored-by: oxoxDev <oxoxdev@users.noreply.github.com>
37 lines
1.5 KiB
Rust
37 lines
1.5 KiB
Rust
//! Integration coverage for the stdio MCP client against the real core binary.
|
|
//!
|
|
//! Keep this as an integration test so Cargo builds `openhuman-core` as part of
|
|
//! the test graph and exposes it through `CARGO_BIN_EXE_openhuman-core`. Running
|
|
//! a nested `cargo build` from a lib unit test is prone to CI disk exhaustion.
|
|
|
|
// Exercises the gated `mcp_client::McpStdioClient` transport, so the whole
|
|
// suite is compiled only when the `mcp` feature is on — otherwise the slim
|
|
// build's `cargo test --no-default-features --features tokenjuice-treesitter
|
|
// --tests` fails to compile against the removed API (#4799).
|
|
#![cfg(feature = "mcp")]
|
|
|
|
use openhuman_core::openhuman::config::McpClientIdentityConfig;
|
|
use openhuman_core::openhuman::mcp_client::McpStdioClient;
|
|
use std::path::PathBuf;
|
|
|
|
const LATEST_PROTOCOL_VERSION: &str = "2025-11-25";
|
|
|
|
#[tokio::test]
|
|
async fn stdio_client_talks_to_openhuman_mcp_server() {
|
|
let client = McpStdioClient::new(
|
|
env!("CARGO_BIN_EXE_openhuman-core").to_string(),
|
|
vec!["mcp".into()],
|
|
Vec::new(),
|
|
Some(PathBuf::from(env!("CARGO_MANIFEST_DIR"))),
|
|
McpClientIdentityConfig::default(),
|
|
);
|
|
|
|
let init = client.initialize().await.expect("initialize");
|
|
assert_eq!(init.protocol_version, LATEST_PROTOCOL_VERSION);
|
|
|
|
let tools = client.list_tools().await.expect("list_tools");
|
|
assert!(tools.iter().any(|tool| tool.name == "memory.search"));
|
|
|
|
client.close_session().await.expect("close");
|
|
}
|