Test coverage and headless nvim bug fixes
This commit is contained in:
1 parent
bffc8896f1
commit
4bae4e9c08
9 files changed
+316
-58
No files matched your search
@@ -344,6 +344,7 @@ impl McpTool for OmniSearchHandler {
|
||||
idx.search(&req.query, req.namespace.as_deref())
|
||||
.unwrap_or_default()
|
||||
};
|
||||
println!("OMNI SEARCH MATCHES: {:?}", matches);
|
||||
|
||||
let kg_json = state.read_graph(|full| {
|
||||
let mut kg_entities = std::collections::HashMap::new();
|
||||
@@ -660,4 +661,40 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_omni_search() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let state = Arc::new(MemoryState::new(dir.path().to_str().unwrap()));
|
||||
|
||||
let task = crate::models::Task {
|
||||
id: "omni-1".to_string(),
|
||||
title: "Omni Task".to_string(),
|
||||
description: "Testing omni search functionality".to_string(),
|
||||
status: "open".to_string(),
|
||||
created_at: 0,
|
||||
updated_at: 0,
|
||||
git_branch: None,
|
||||
parent_id: None,
|
||||
dependencies: vec![],
|
||||
acceptance_criteria: vec![],
|
||||
};
|
||||
|
||||
{
|
||||
state.tasks.modify(|t| {
|
||||
t.push(task.clone());
|
||||
});
|
||||
}
|
||||
|
||||
state.rebuild_index().await;
|
||||
state.get_search_index().reader.reload().unwrap();
|
||||
|
||||
let omni = OmniSearchHandler;
|
||||
let omni_res = omni
|
||||
.execute(json!({"query": "Omni"}), state.clone())
|
||||
.await
|
||||
.unwrap();
|
||||
println!("OMNI RES: {}", omni_res);
|
||||
assert!(omni_res.contains("omni-1"), "omni search should return results containing the task id");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user