@@ -2932,6 +2932,41 @@ output="$(docker_e2e_maybe_print_log_heartbeat plugins-run 1 1 "$TMPDIR/run.log"
29322932 execFileSync ( "bash" , [ "-lc" , script ] , { encoding : "utf8" } ) ;
29332933 } ) ;
29342934
2935+ it ( "preserves heredoc stdin through Docker E2E heartbeat logging" , ( ) => {
2936+ const workDir = tempDirs . make ( "openclaw-docker-e2e-log-stdin-" ) ;
2937+ const script = repoShell ( workDir ) `
2938+
2939+ source "$ROOT_DIR/scripts/lib/docker-e2e-logs.sh"
2940+
2941+ run_logged_print_heartbeat plugins-run 30 bash -s <<'SH'
2942+ printf "first payload line\\nsecond payload line\\n"
2943+ SH
2944+ ` ;
2945+
2946+ expect ( execFileSync ( "bash" , [ "-lc" , script ] , { encoding : "utf8" } ) ) . toBe (
2947+ "first payload line\nsecond payload line\n" ,
2948+ ) ;
2949+ } ) ;
2950+
2951+ it ( "preserves failing heredoc output and status through Docker E2E heartbeat logging" , ( ) => {
2952+ const workDir = tempDirs . make ( "openclaw-docker-e2e-log-failing-stdin-" ) ;
2953+ const script = repoShell ( workDir ) `
2954+
2955+ source "$ROOT_DIR/scripts/lib/docker-e2e-logs.sh"
2956+
2957+ run_logged_print_heartbeat plugins-run 30 bash -s <<'SH'
2958+ printf "captured failure output\\n"
2959+ exit 37
2960+ SH
2961+ ` ;
2962+
2963+ const result = spawnSync ( "bash" , [ "-lc" , script ] , { encoding : "utf8" } ) ;
2964+
2965+ expect ( result . status ) . toBe ( 37 ) ;
2966+ expect ( result . stdout ) . toBe ( "captured failure output\n" ) ;
2967+ expect ( result . stderr ) . toBe ( "" ) ;
2968+ } ) ;
2969+
29352970 it ( "cleans the heartbeat command when the wrapper is terminated" , ( ) => {
29362971 const workDir = tempDirs . make ( "openclaw-docker-e2e-log-term-cleanup-" ) ;
29372972 const script = repoShell ( workDir ) `
0 commit comments