Lightweight coding agent that runs in your terminal
Rust
tests(js_repl): remove node-related skip paths from js_repl tests (#12185)
Curtis 'Fjord' Hawthorne9501669a2485
diff --git a/codex-rs/core/src/tools/js_repl/mod.rs b/codex-rs/core/src/tools/js_repl/mod.rsindex 3ae9cff62f..066cb8258c 100644--- a/codex-rs/core/src/tools/js_repl/mod.rs+++ b/codex-rs/core/src/tools/js_repl/mod.rs@@ -1636,29 +1636,11 @@ mod tests {}async fn can_run_js_repl_runtime_tests() -> bool {- // These white-box runtime tests rely on the unit-test harness and are- // only required on macOS. Linux uses the codex-linux-sandbox arg0- // dispatch path, which is exercised in integration tests instead.- if !cfg!(target_os = "macos") {- return false;- }- if std::env::var_os("CODEX_SANDBOX").is_some() {- return false;- }- let Some(node_path) = resolve_node(None) else {- return false;- };- let required = match required_node_version() {- Ok(v) => v,- Err(_) => return false,- };- let found = match read_node_version(&node_path).await {- Ok(v) => v,- Err(_) => return false,- };- found >= required+ // These white-box runtime tests are required on macOS. Linux relies on+ // the codex-linux-sandbox arg0 dispatch path, which is exercised in+ // integration tests instead.+ cfg!(target_os = "macos")}-fn write_js_repl_test_package(base: &Path, name: &str, value: &str) -> anyhow::Result<()> {let pkg_dir = base.join("node_modules").join(name);fs::create_dir_all(&pkg_dir)?;diff --git a/codex-rs/core/tests/suite/js_repl.rs b/codex-rs/core/tests/suite/js_repl.rsindex 364b077262..ba2b52fd6d 100644--- a/codex-rs/core/tests/suite/js_repl.rs+++ b/codex-rs/core/tests/suite/js_repl.rs@@ -12,7 +12,6 @@ use core_test_support::responses::ev_response_created;use core_test_support::responses::sse;use core_test_support::skip_if_no_network;use core_test_support::test_codex::test_codex;-use which::which;use wiremock::MockServer;fn custom_tool_output_text_and_success(@@ -55,25 +54,10 @@ async fn run_js_repl_turn(Ok(second_mock)}-fn can_run_js_repl_runtime_tests() -> bool {- // In the base CI-stabilization commit, skip these integration tests only- // when the js_repl Node runtime is not available. A later stacked commit- // removes this automatic skip and requires them everywhere.- if let Some(path) = std::env::var_os("CODEX_JS_REPL_NODE_PATH")- && std::path::Path::new(&path).exists()- {- return true;- }- which("node").is_ok()-}#[tokio::test(flavor = "multi_thread", worker_threads = 2)]async fn js_repl_persists_top_level_bindings_and_supports_tla() -> Result<()> {skip_if_no_network!(Ok(()));- if !can_run_js_repl_runtime_tests() {- return Ok(());- }-let server = responses::start_mock_server().await;let mut builder = test_codex().with_config(|config| {config.features.enable(Feature::JsRepl);@@ -138,10 +122,6 @@ async fn js_repl_persists_top_level_bindings_and_supports_tla() -> Result<()> {async fn js_repl_can_invoke_builtin_tools() -> Result<()> {skip_if_no_network!(Ok(()));- if !can_run_js_repl_runtime_tests() {- return Ok(());- }-let server = responses::start_mock_server().await;let mock = run_js_repl_turn(&server,@@ -169,10 +149,6 @@ async fn js_repl_can_invoke_builtin_tools() -> Result<()> {async fn js_repl_tool_call_rejects_recursive_js_repl_invocation() -> Result<()> {skip_if_no_network!(Ok(()));- if !can_run_js_repl_runtime_tests() {- return Ok(());- }-let server = responses::start_mock_server().await;let mock = run_js_repl_turn(&server,@@ -214,10 +190,6 @@ try {async fn js_repl_does_not_expose_process_global() -> Result<()> {skip_if_no_network!(Ok(()));- if !can_run_js_repl_runtime_tests() {- return Ok(());- }-let server = responses::start_mock_server().await;let mock = run_js_repl_turn(&server,@@ -242,10 +214,6 @@ async fn js_repl_does_not_expose_process_global() -> Result<()> {async fn js_repl_blocks_sensitive_builtin_imports() -> Result<()> {skip_if_no_network!(Ok(()));- if !can_run_js_repl_runtime_tests() {- return Ok(());- }-let server = responses::start_mock_server().await;let mock = run_js_repl_turn(&server,diff --git a/codex-rs/core/tests/suite/view_image.rs b/codex-rs/core/tests/suite/view_image.rsindex d3b7195504..36ccf1a25e 100644--- a/codex-rs/core/tests/suite/view_image.rs+++ b/codex-rs/core/tests/suite/view_image.rs@@ -362,12 +362,6 @@ console.log(out.output?.body?.text ?? "");.custom_tool_call_output_content_and_success(call_id).expect("custom tool output present");let js_repl_output = js_repl_output.expect("custom tool output text present");- if js_repl_output.contains("Node runtime not found")- || js_repl_output.contains("Node runtime too old for js_repl")- {- eprintln!("Skipping js_repl image test: {js_repl_output}");- return Ok(());- }assert_ne!(js_repl_success,Some(false),