test: restore e2e cleanup

This commit is contained in:
Agent Zero
2026-03-19 13:37:44 -04:00
parent 1b42989dbb
commit d7140eb7f3

View File

@@ -889,10 +889,16 @@ async fn e2e_batch_store_basic() -> anyhow::Result<()> {
wait_until_ready(&client, &base).await;
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!({
"agent_id": agent,
"agent_id": agent.clone(),
"entries": [
{"content": "Fact alpha for batch test"},
{"content": "Fact beta for batch test"},
@@ -900,6 +906,14 @@ async fn e2e_batch_store_basic() -> anyhow::Result<()> {
]
})).await;
let _ = call_tool(
&client,
&base,
"purge",
json!({ "agent_id": agent, "confirm": true }),
)
.await;
assert!(result["success"].as_bool().unwrap_or(false));
assert_eq!(result["count"].as_i64().unwrap_or(0), 3);
Ok(())
@@ -1045,13 +1059,27 @@ async fn e2e_existing_store_unchanged() -> anyhow::Result<()> {
wait_until_ready(&client, &base).await;
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!({
"agent_id": agent,
"agent_id": agent.clone(),
"content": "Original store still works"
})).await;
let _ = call_tool(
&client,
&base,
"purge",
json!({ "agent_id": agent, "confirm": true }),
)
.await;
assert!(result["success"].as_bool().unwrap_or(false));
Ok(())
}