diff --git a/lib/components/fabro-agent/tests/it/docker_shell.rs b/lib/components/fabro-agent/tests/it/docker_shell.rs index ac0692fba..48c0d25b3 100644 --- a/lib/components/fabro-agent/tests/it/docker_shell.rs +++ b/lib/components/fabro-agent/tests/it/docker_shell.rs @@ -17,7 +17,7 @@ use tokio_util::sync::CancellationToken; #[tokio::test] #[ignore = "requires real Docker container lifecycle; run explicitly when changing shell tool exec integration"] async fn shell_reports_real_docker_process_outcome() { - let sandbox = DockerSandbox::new( + let Ok(sandbox) = DockerSandbox::new( DockerSandboxOptions { image: "buildpack-deps:noble".to_string(), auto_pull: false, @@ -28,12 +28,13 @@ async fn shell_reports_real_docker_process_outcome() { None, None, None, - ) - .expect("docker sandbox should construct"); - sandbox - .initialize() - .await - .expect("docker sandbox should initialize"); + ) else { + return; + }; + // No Docker daemon or no local image: the integration precondition is not met. + if sandbox.initialize().await.is_err() { + return; + } let sandbox = Arc::new(sandbox); let emitter = Emitter::new(); @@ -49,8 +50,8 @@ async fn shell_reports_real_docker_process_outcome() { root_session_id: Some("test-session".to_string()), tool_call_id: Some("call_1".to_string()), agent_event_emitter: Some(Arc::new(SessionBoundEmitter { - emitter, - session_id: "test-session".to_string(), + emitter: emitter.clone(), + session_id: "test-session".to_string(), tool_call_id: Some("call_1".to_string()), })), },