mirror of
https://github.com/katanemo/plano.git
synced 2026-06-26 15:39:40 +02:00
fix tests
This commit is contained in:
parent
358fa856c4
commit
5833e6de2b
3 changed files with 9 additions and 4 deletions
|
|
@ -222,6 +222,7 @@ mod tests {
|
||||||
kind: Some("test".to_string()),
|
kind: Some("test".to_string()),
|
||||||
url: "http://localhost:8080".to_string(),
|
url: "http://localhost:8080".to_string(),
|
||||||
tool: None,
|
tool: None,
|
||||||
|
transport: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ mod integration_tests {
|
||||||
// Setup services
|
// Setup services
|
||||||
let router_service = create_test_router_service();
|
let router_service = create_test_router_service();
|
||||||
let agent_selector = AgentSelector::new(router_service);
|
let agent_selector = AgentSelector::new(router_service);
|
||||||
let pipeline_processor = PipelineProcessor::default();
|
let mut pipeline_processor = PipelineProcessor::default();
|
||||||
|
|
||||||
// Create test data
|
// Create test data
|
||||||
let agents = vec![
|
let agents = vec![
|
||||||
|
|
@ -50,11 +50,15 @@ mod integration_tests {
|
||||||
id: "filter-agent".to_string(),
|
id: "filter-agent".to_string(),
|
||||||
kind: Some("filter".to_string()),
|
kind: Some("filter".to_string()),
|
||||||
url: "http://localhost:8081".to_string(),
|
url: "http://localhost:8081".to_string(),
|
||||||
|
tool: None,
|
||||||
|
transport: None,
|
||||||
},
|
},
|
||||||
Agent {
|
Agent {
|
||||||
id: "terminal-agent".to_string(),
|
id: "terminal-agent".to_string(),
|
||||||
kind: Some("terminal".to_string()),
|
kind: Some("terminal".to_string()),
|
||||||
url: "http://localhost:8082".to_string(),
|
url: "http://localhost:8082".to_string(),
|
||||||
|
tool: None,
|
||||||
|
transport: None,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -107,7 +111,7 @@ mod integration_tests {
|
||||||
|
|
||||||
let headers = HeaderMap::new();
|
let headers = HeaderMap::new();
|
||||||
let result = pipeline_processor
|
let result = pipeline_processor
|
||||||
.process_filter_chain(&request, &test_pipeline, &agent_map, &headers)
|
.process_filter_chain(&request.messages, &test_pipeline, &agent_map, &headers)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
println!("Pipeline processing result: {:?}", result);
|
println!("Pipeline processing result: {:?}", result);
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ mod tests {
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_agent_not_found_error() {
|
async fn test_agent_not_found_error() {
|
||||||
let processor = PipelineProcessor::default();
|
let mut processor = PipelineProcessor::default();
|
||||||
let agent_map = HashMap::new();
|
let agent_map = HashMap::new();
|
||||||
let request_headers = HeaderMap::new();
|
let request_headers = HeaderMap::new();
|
||||||
|
|
||||||
|
|
@ -404,7 +404,7 @@ mod tests {
|
||||||
let pipeline = create_test_pipeline(vec!["nonexistent-agent", "terminal-agent"]);
|
let pipeline = create_test_pipeline(vec!["nonexistent-agent", "terminal-agent"]);
|
||||||
|
|
||||||
let result = processor
|
let result = processor
|
||||||
.process_filter_chain(&initial_request, &pipeline, &agent_map, &request_headers)
|
.process_filter_chain(&initial_request.messages, &pipeline, &agent_map, &request_headers)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert!(result.is_err());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue