mirror of
https://gitea.ingwaz.work/Ingwaz/openbrain-mcp.git
synced 2026-03-31 14:49:06 +00:00
test: restore e2e cleanup
This commit is contained in:
@@ -889,10 +889,16 @@ async fn e2e_batch_store_basic() -> anyhow::Result<()> {
|
|||||||
wait_until_ready(&client, &base).await;
|
wait_until_ready(&client, &base).await;
|
||||||
|
|
||||||
let agent = format!("batch_{}", uuid::Uuid::new_v4());
|
let agent = format!("batch_{}", uuid::Uuid::new_v4());
|
||||||
let _ = call_tool(&client, &base, "purge", json!({ "agent_id": agent, "confirm": true })).await;
|
let _ = call_tool(
|
||||||
|
&client,
|
||||||
|
&base,
|
||||||
|
"purge",
|
||||||
|
json!({ "agent_id": agent.clone(), "confirm": true }),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
let result = call_tool(&client, &base, "batch_store", serde_json::json!({
|
let result = call_tool(&client, &base, "batch_store", serde_json::json!({
|
||||||
"agent_id": agent,
|
"agent_id": agent.clone(),
|
||||||
"entries": [
|
"entries": [
|
||||||
{"content": "Fact alpha for batch test"},
|
{"content": "Fact alpha for batch test"},
|
||||||
{"content": "Fact beta for batch test"},
|
{"content": "Fact beta for batch test"},
|
||||||
@@ -900,6 +906,14 @@ async fn e2e_batch_store_basic() -> anyhow::Result<()> {
|
|||||||
]
|
]
|
||||||
})).await;
|
})).await;
|
||||||
|
|
||||||
|
let _ = call_tool(
|
||||||
|
&client,
|
||||||
|
&base,
|
||||||
|
"purge",
|
||||||
|
json!({ "agent_id": agent, "confirm": true }),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
assert!(result["success"].as_bool().unwrap_or(false));
|
assert!(result["success"].as_bool().unwrap_or(false));
|
||||||
assert_eq!(result["count"].as_i64().unwrap_or(0), 3);
|
assert_eq!(result["count"].as_i64().unwrap_or(0), 3);
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -1045,13 +1059,27 @@ async fn e2e_existing_store_unchanged() -> anyhow::Result<()> {
|
|||||||
wait_until_ready(&client, &base).await;
|
wait_until_ready(&client, &base).await;
|
||||||
|
|
||||||
let agent = format!("compat_{}", uuid::Uuid::new_v4());
|
let agent = format!("compat_{}", uuid::Uuid::new_v4());
|
||||||
let _ = call_tool(&client, &base, "purge", json!({ "agent_id": agent, "confirm": true })).await;
|
let _ = call_tool(
|
||||||
|
&client,
|
||||||
|
&base,
|
||||||
|
"purge",
|
||||||
|
json!({ "agent_id": agent.clone(), "confirm": true }),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
let result = call_tool(&client, &base, "store", serde_json::json!({
|
let result = call_tool(&client, &base, "store", serde_json::json!({
|
||||||
"agent_id": agent,
|
"agent_id": agent.clone(),
|
||||||
"content": "Original store still works"
|
"content": "Original store still works"
|
||||||
})).await;
|
})).await;
|
||||||
|
|
||||||
|
let _ = call_tool(
|
||||||
|
&client,
|
||||||
|
&base,
|
||||||
|
"purge",
|
||||||
|
json!({ "agent_id": agent, "confirm": true }),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
assert!(result["success"].as_bool().unwrap_or(false));
|
assert!(result["success"].as_bool().unwrap_or(false));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user