Files
codex/codex-rs/exec-server/BUILD.bazel
T
Anthony Tafoya 0b255ab853 Clarify the Code Mode result default and scope the Bazel test helper (#64678)
## What changed

- Rename the zero-valued `ToolResultFormat` member to
  `TOOL_RESULT_FORMAT_JSON_OR_UNSPECIFIED` and update both Rust gRPC
  endpoints. The default still preserves the full JSON value when the
  format is omitted or unknown.
- Tag `exec-server-test-helper` as `manual` so Bazel wildcard builds skip
  the standalone target. Exec-server tests still pull it in on musl.

GitOrigin-RevId: 7fa5b7c8a7448883ddb5b968fefc085be1ebd931
2026-11-30 04:53:40 +00:00

79 lines
2.4 KiB
Python

load("@rules_rust//rust:defs.bzl", "rust_binary")
load("//:defs.bzl", "codex_rust_crate")
load("//bazel/rules/testing/compat:exec_server_compat_test.bzl", "exec_server_compat_test")
exports_files(
["src/proto/codex.exec_server.relay.v1.rs"],
visibility = ["//codex-rs/exec-server/tests/support:__pkg__"],
)
codex_rust_crate(
name = "exec-server",
crate_name = "codex_exec_server",
crate_srcs = glob([
"src/**/*.rs",
"tests/unit/**/*.rs",
]),
extra_binaries = [
"//codex-rs/bwrap:bwrap",
"//codex-rs/windows-sandbox-rs:codex-command-runner",
"//codex-rs/windows-sandbox-rs:codex-windows-sandbox-setup",
],
integration_compile_data_extra = [
"src/proto/codex.exec_server.relay.v1.rs",
],
# Keep the crate's tests single-threaded under Bazel because they install
# process-global test-binary dispatch state, and the remote exec-server
# cases already rely on serialization around the full CLI path.
integration_test_args = ["--test-threads=1"],
test_data_extra = [":musl-test-helper"],
test_tags = ["no-sandbox"],
unit_test_args = ["--test-threads=1"],
)
filegroup(
name = "musl-test-helper",
testonly = True,
srcs = select({
"@llvm//constraints/libc:musl": [":exec-server-test-helper"],
"//conditions:default": [],
}),
)
rust_binary(
name = "exec-server-test-helper",
testonly = True,
srcs = ["tests/common/mod.rs"],
crate_root = "tests/common/mod.rs",
edition = "2024",
tags = ["manual"],
target_compatible_with = ["@llvm//constraints/libc:musl"],
deps = [
":exec-server",
"//codex-rs/build-info",
"//codex-rs/http-client",
"//codex-rs/sandboxing",
"//codex-rs/test-binary-support",
"//codex-rs/websocket-auth",
"@crates//tokio",
"@crates//tracing-subscriber",
],
)
exec_server_compat_test(
name = "exec-server-current-version-test",
comparison_binary = "//codex-rs/cli:codex",
current_binary = "//codex-rs/cli:codex",
)
# Preparation selects both releases; the normal Bazel test invocation runs them.
exec_server_compat_test(
name = "exec-server-stable-release-test",
release = "@codex_release_latest_stable",
)
exec_server_compat_test(
name = "exec-server-historical-release-test",
release = "@codex_release_historical_stable",
)