diff --git a/codex-rs/core/tests/common/lib.rs b/codex-rs/core/tests/common/lib.rs index ce90f39720..a98db4d0f1 100644 --- a/codex-rs/core/tests/common/lib.rs +++ b/codex-rs/core/tests/common/lib.rs @@ -7,6 +7,9 @@ use codex_core::config::Config; use codex_core::config::ConfigOverrides; use codex_core::config::ConfigToml; +#[cfg(target_os = "linux")] +use assert_cmd::cargo::cargo_bin; + pub mod responses; pub mod test_codex; pub mod test_codex_exec; @@ -17,12 +20,24 @@ pub mod test_codex_exec; pub fn load_default_config_for_test(codex_home: &TempDir) -> Config { Config::load_from_base_config_with_overrides( ConfigToml::default(), - ConfigOverrides::default(), + default_test_overrides(), codex_home.path().to_path_buf(), ) .expect("defaults for test should always succeed") } +#[cfg(target_os = "linux")] +fn default_test_overrides() -> ConfigOverrides { + let mut overrides = ConfigOverrides::default(); + overrides.codex_linux_sandbox_exe = Some(cargo_bin("codex-linux-sandbox")); + overrides +} + +#[cfg(not(target_os = "linux"))] +fn default_test_overrides() -> ConfigOverrides { + ConfigOverrides::default() +} + /// Builds an SSE stream body from a JSON fixture. /// /// The fixture must contain an array of objects where each object represents a