Skip to content

Commit 858df2c

Browse files
author
codex-bot
committed
Fix unified exec large output regex and remove python dependency
1 parent 88da499 commit 858df2c

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎codex-rs/core/tests/suite/unified_exec.rs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,11 +1621,8 @@ async fn unified_exec_formats_large_output_summary() -> Result<()> {
16211621
..
16221622
} = builder.build(&server).await?;
16231623

1624-
let script = r#"python3 - <<'PY'
1625-
import sys
1626-
sys.stdout.write("token token \n" * 5000)
1627-
PY
1628-
"#;
1624+
// Avoid external deps (python) on CI runners; rely on coreutils/yes.
1625+
let script = r#"yes "token token " | head -n 5000"#;
16291626

16301627
let call_id = "uexec-large-output";
16311628
let args = serde_json::json!({
@@ -1678,7 +1675,8 @@ PY
16781675
let large_output = outputs.get(call_id).expect("missing large output summary");
16791676

16801677
let output_text = large_output.output.replace("\r\n", "\n");
1681-
let truncated_pattern = r"(?s)^Total output lines: \d+\n{2,}(token token \n){5,}.*…\d+ tokens truncated….*(token token \n){5,}$";
1678+
let output_text = output_text.trim_end();
1679+
let truncated_pattern = r"(?s)^Total output lines: \d+\n{2,}(token token ?\n){5,}.*…\d+ tokens truncated….*(token token ?\n?){5,}\s*$";
16821680
assert_regex_match(truncated_pattern, &output_text);
16831681

16841682
let original_tokens = large_output

0 commit comments

Comments
 (0)