mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
## Why Some test fixtures depend on `python3` being on the host's `PATH` or on reading Rust's process arguments from a constructor. Bazel workers need a declared Python runtime, and musl does not provide those arguments to constructors. ## What changed - Put Bazel's Python 3.12 runtime on `PATH` for Linux test suites that invoke `python3`, including their Wine launchers. - Use standalone helper binaries for exec-server and sandbox fixtures on musl, and read `/proc/self/cmdline` for the MCP hook fixture. - Add launcher options for test execution tags and for routing selected Linux cases to a local companion target that shares the test binary. - Adjust test fixtures for platform differences in file creation timestamps and shell script execution. Keep cloud-config error tests pointed at their mock server after startup falls back to defaults. ## Testing Exercise marketplace upgrade negotiation at Git 2.20 and check whether the installed Git supports limiting the refs advertised by the clone. GitOrigin-RevId: 3a83cde954d52ca29d346d67488c9a25c0790614
78 lines
2.3 KiB
Python
78 lines
2.3 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",
|
|
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",
|
|
)
|