Fix Bazel test configuration for platform-specific data (#35067)

## What changed

- Include CLI snapshot files in Bazel test runfiles.
- Restrict the Windows sandbox binary test target to Windows.
- Label boolean and optional arguments in the affected CLI tests.

GitOrigin-RevId: c248396c51d881c38856739d7d9b653dcde1823e
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-07-24 01:34:56 +00:00
1 parent 3947f0d0c3
commit f47f28cd0d
4 files changed
+21 -10

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ codex_rust_crate(
"//codex-rs/bwrap:bwrap", "//codex-rs/bwrap:bwrap",
], ],
rustc_flags_extra = MACOS_WEBRTC_RUSTC_LINK_FLAGS, rustc_flags_extra = MACOS_WEBRTC_RUSTC_LINK_FLAGS,
test_data_extra = glob(["src/**/snapshots/**"]),
) )
multiplatform_binaries( multiplatform_binaries(
+3 -2
View File
@@ -3066,9 +3066,10 @@ mod tests {
#[test] #[test]
fn delete_force_requires_uuid() { fn delete_force_requires_uuid() {
assert!(delete_action("123e4567-e89b-12d3-a456-426614174000", true).is_ok()); assert!(delete_action("123e4567-e89b-12d3-a456-426614174000", /*force*/ true).is_ok());
let err = delete_action("my-thread", true).expect_err("name should require prompt"); let err =
delete_action("my-thread", /*force*/ true).expect_err("name should require prompt");
assert_eq!( assert_eq!(
err.to_string(), err.to_string(),
"--force requires a session UUID; names must be confirmed interactively" "--force requires a session UUID; names must be confirmed interactively"
+16 -8
View File
@@ -673,17 +673,22 @@ mod tests {
#[test] #[test]
fn remote_control_pairing_human_output_labels_the_manual_code() { fn remote_control_pairing_human_output_labels_the_manual_code() {
assert_eq!( assert_eq!(
format_remote_control_pairing_output(&pairing_response(Some("ABCD-EFGH")), false) format_remote_control_pairing_output(
.expect("manual pairing output"), &pairing_response(Some("ABCD-EFGH")),
/*json*/ false,
)
.expect("manual pairing output"),
"Pairing code: ABCD-EFGH" "Pairing code: ABCD-EFGH"
); );
} }
#[test] #[test]
fn remote_control_pairing_json_output_preserves_pairing_artifacts() { fn remote_control_pairing_json_output_preserves_pairing_artifacts() {
let output = let output = format_remote_control_pairing_output(
format_remote_control_pairing_output(&pairing_response(Some("ABCD-EFGH")), true) &pairing_response(Some("ABCD-EFGH")),
.expect("pairing JSON output"); /*json*/ true,
)
.expect("pairing JSON output");
assert_eq!( assert_eq!(
serde_json::from_str::<serde_json::Value>(&output).expect("valid JSON"), serde_json::from_str::<serde_json::Value>(&output).expect("valid JSON"),
json!({ json!({
@@ -698,9 +703,12 @@ mod tests {
#[test] #[test]
fn remote_control_pairing_human_output_requires_manual_code() { fn remote_control_pairing_human_output_requires_manual_code() {
assert_eq!( assert_eq!(
format_remote_control_pairing_output(&pairing_response(None), false) format_remote_control_pairing_output(
.expect_err("missing manual pairing code should fail") &pairing_response(/*manual_pairing_code*/ None),
.to_string(), /*json*/ false,
)
.expect_err("missing manual pairing code should fail")
.to_string(),
"remote-control pairing response did not include a manual pairing code" "remote-control pairing response did not include a manual pairing code"
); );
} }
+1
View File
@@ -2,6 +2,7 @@ load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate( codex_rust_crate(
name = "windows-sandbox-rs", name = "windows-sandbox-rs",
binary_test_target_compatible_with = ["@platforms//os:windows"],
build_script_data = [ build_script_data = [
"codex-windows-sandbox-setup.manifest", "codex-windows-sandbox-setup.manifest",
], ],