test(agent): honor Docker shell integration preconditions

This commit is contained in:
Bryan Helmkamp 2026-07-24 22:35:51 -04:00
parent 9083b1b035
commit 4d5458b64c
No known key found for this signature in database

View file

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