fix tests

This commit is contained in:
Adil Hafeez 2025-12-15 23:08:54 -08:00
parent 358fa856c4
commit 5833e6de2b
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
3 changed files with 9 additions and 4 deletions

View file

@ -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,
} }
} }

View file

@ -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);

View file

@ -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());