Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Stage Bazel app-server test binaries in `TEST_TMPDIR` (#37343)

jifa9da0bdbac5c
diff --git a/codex-rs/app-server/tests/common/test_app_server.rs b/codex-rs/app-server/tests/common/test_app_server.rs
index f5650a4287..3b9f774d8f 100644
--- a/codex-rs/app-server/tests/common/test_app_server.rs
+++ b/codex-rs/app-server/tests/common/test_app_server.rs
@@ -2022,7 +2022,12 @@ impl TestAppServerBuilder {
{
// Bazel keeps binary targets in separate package directories.
// Recreate the installed sibling layout without a path override.
- let install_dir = TempDir::new()?;
+ // Prefer Bazel's TEST_TMPDIR so staging can share a filesystem with
+ // the binaries and avoid expensive cross-filesystem copies.
+ let install_dir = match std::env::var_os("TEST_TMPDIR") {
+ Some(test_tmpdir) => TempDir::new_in(test_tmpdir)?,
+ None => TempDir::new()?,
+ };
let staged_program = install_dir.path().join(
program
.file_name()