test: generalize exec-server fixture (#31422)

## Why

Remote-executor integration tests need one host-agnostic exec-server
fixture target instead of a Windows-only wrapper.

## What

- rename the testing binary target to exec-server
- make the fixture source and target host-agnostic
- update Windows remote-executor test wiring to use the shared target

## Validation

- bazel build //codex-rs/exec-server/testing:exec-server
- bazel cquery --config=ci-windows-cross
'set(//codex-rs/exec-server/testing:exec-server
//codex-rs/core/tests/remote_env_windows:smoke-test)'

## Stack

1. [#31422 test: generalize exec-server
fixture](https://github.com/openai/codex/pull/31422)
2. [#31425 test: add TestAppServer
builder](https://github.com/openai/codex/pull/31425)
3. [#31427 test: add delayed exec-server
transport](https://github.com/openai/codex/pull/31427)
4. [#31295 bench: add cold skill load
macrobenchmark](https://github.com/openai/codex/pull/31295)
5. [#31428 bench: add e2e benchmark
entrypoints](https://github.com/openai/codex/pull/31428)
6. [#31429 ci: smoke Bazel e2e
benchmarks](https://github.com/openai/codex/pull/31429)
This commit is contained in:
Adam Perry @ OpenAI
2026-07-07 11:21:56 -07:00
committed by GitHub
parent 358575465c
commit f158b31db5
5 changed files with 20 additions and 26 deletions

View File

@@ -7,7 +7,7 @@ wine_rust_test(
crate_name = "remote_env_windows_test",
crate_root = "remote_env_windows_test.rs",
windows_binaries = {
"wine-windows-exec-server": "//codex-rs/exec-server/testing:windows-exec-server",
"wine-windows-exec-server": "//codex-rs/exec-server/testing:exec-server",
},
deps = [
"//codex-rs/core/tests/common",

View File

@@ -32,13 +32,11 @@ rust_binary(
)
rust_binary(
name = "windows-exec-server",
name = "exec-server",
testonly = True,
srcs = ["windows_exec_server.rs"],
crate_name = "windows_exec_server",
crate_root = "windows_exec_server.rs",
tags = ["manual"],
target_compatible_with = ["@platforms//os:windows"],
srcs = ["exec_server.rs"],
crate_name = "exec_server",
crate_root = "exec_server.rs",
visibility = ["//visibility:public"],
deps = [
"//codex-rs/exec-server",

View File

@@ -0,0 +1,14 @@
//! Minimal exec-server fixture for Bazel-only integration tests.
//!
//! Linking only exec-server avoids depending on the full Codex CLI binary
//! when a test only needs a WebSocket executor endpoint.
use codex_exec_server::ExecServerRuntimePaths;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let current_exe = std::env::current_exe()?;
let runtime_paths =
ExecServerRuntimePaths::new(current_exe, /*codex_linux_sandbox_exe*/ None)?;
codex_exec_server::run_main("ws://127.0.0.1:0", runtime_paths).await
}

View File

@@ -1,18 +0,0 @@
//! Minimal Windows exec-server fixture for cross-platform tests.
//!
//! Keeping this wrapper separate avoids depending on the full Codex binary's
//! Windows cross-build, which is not yet supported by the Bazel graph. Linking
//! only the exec-server also makes the Wine test substantially faster to
//! iterate on.
use codex_exec_server::ExecServerRuntimePaths;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let current_exe = std::env::current_exe()?;
// This fixture is always a Windows executable, so it neither invokes nor
// needs the separate Linux sandbox binary.
let runtime_paths =
ExecServerRuntimePaths::new(current_exe, /*codex_linux_sandbox_exe*/ None)?;
codex_exec_server::run_main("ws://127.0.0.1:0", runtime_paths).await
}

View File

@@ -538,7 +538,7 @@ def codex_rust_crate(
wine_exec_server = wine_test_name + "-windows-exec-server"
foreign_platform_binary(
name = wine_exec_server,
binary = "//codex-rs/exec-server/testing:windows-exec-server",
binary = "//codex-rs/exec-server/testing:exec-server",
extra_rustc_flags = WINDOWS_GNULLVM_RUSTC_LINK_FLAGS,
platform = "//:windows_x86_64_gnullvm",
tags = ["manual"],