diff --git a/codex-rs/agent-graph-store/BUILD.bazel b/codex-rs/agent-graph-store/BUILD.bazel index 8556291e9a..96c077e263 100644 --- a/codex-rs/agent-graph-store/BUILD.bazel +++ b/codex-rs/agent-graph-store/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "agent-graph-store", crate_name = "codex_agent_graph_store", - test_sizes = { - "agent-graph-store-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/agent-identity/BUILD.bazel b/codex-rs/agent-identity/BUILD.bazel index 1e5aecd85e..d1363c468f 100644 --- a/codex-rs/agent-identity/BUILD.bazel +++ b/codex-rs/agent-identity/BUILD.bazel @@ -3,10 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "agent-identity", crate_name = "codex_agent_identity", - # This test is short once running, but it hit the 60s Windows timeout when - # several freshly invalidated tests launched together. Serialize local runs - # to avoid runner startup contention while keeping the small test size. - test_tags_by_target = { - "agent-identity-unit-tests-windows-cross": ["exclusive-if-local"], - }, ) diff --git a/codex-rs/app-server-protocol/BUILD.bazel b/codex-rs/app-server-protocol/BUILD.bazel index 8842a58587..af8c039688 100644 --- a/codex-rs/app-server-protocol/BUILD.bazel +++ b/codex-rs/app-server-protocol/BUILD.bazel @@ -7,7 +7,4 @@ codex_rust_crate( ["schema/**"], allow_empty = True, ), - test_sizes = { - "app-server-protocol-schema_fixtures-test-windows-cross": "medium", - }, ) diff --git a/codex-rs/app-server-transport/BUILD.bazel b/codex-rs/app-server-transport/BUILD.bazel index 313437ec77..f6ecba6804 100644 --- a/codex-rs/app-server-transport/BUILD.bazel +++ b/codex-rs/app-server-transport/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "app-server-transport", crate_name = "codex_app_server_transport", - test_sizes = { - "app-server-transport-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/app-server/BUILD.bazel b/codex-rs/app-server/BUILD.bazel index ca1030c916..5217e2337a 100644 --- a/codex-rs/app-server/BUILD.bazel +++ b/codex-rs/app-server/BUILD.bazel @@ -18,11 +18,11 @@ codex_rust_crate( # long. Using a higher shard count for app-server-all-test should help # mitigate this risk. "app-server-all-test": 32, + # Windows-cross tests get a five-minute budget and pay more per-shard + # process startup overhead, so fewer shards keep the work comfortably + # under budget without multiplying that overhead. "app-server-all-test-windows-cross": 8, "app-server-unit-tests": 8, }, - test_sizes = { - "app-server-all-test-windows-cross": "medium", - }, test_tags = ["no-sandbox"], ) diff --git a/codex-rs/apply-patch/BUILD.bazel b/codex-rs/apply-patch/BUILD.bazel index 081c3ffd30..b43e8ed6aa 100644 --- a/codex-rs/apply-patch/BUILD.bazel +++ b/codex-rs/apply-patch/BUILD.bazel @@ -3,16 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "apply-patch", crate_name = "codex_apply_patch", - test_sizes = { - "apply-patch-all-test-windows-cross": "medium", - }, - # Cold Windows runs take about 54s, while remote results have reported - # about 1s and made the medium budget look oversized. Run it alone and - # bypass remote test-result caching so CI measures the cold runtime. - test_tags_by_target = { - "apply-patch-all-test-windows-cross": [ - "exclusive-if-local", - "no-remote-cache", - ], - }, ) diff --git a/codex-rs/code-mode-protocol/BUILD.bazel b/codex-rs/code-mode-protocol/BUILD.bazel index 81b4f6b1fb..ebf43b9bba 100644 --- a/codex-rs/code-mode-protocol/BUILD.bazel +++ b/codex-rs/code-mode-protocol/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "code-mode-protocol", crate_name = "codex_code_mode_protocol", - test_sizes = { - "code-mode-protocol-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/codex-api/BUILD.bazel b/codex-rs/codex-api/BUILD.bazel index b9dc352829..c87c905260 100644 --- a/codex-rs/codex-api/BUILD.bazel +++ b/codex-rs/codex-api/BUILD.bazel @@ -3,8 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "codex-api", crate_name = "codex_api", - test_sizes = { - "codex-api-clients-test-windows-cross": "medium", - "codex-api-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/codex-backend-openapi-models/BUILD.bazel b/codex-rs/codex-backend-openapi-models/BUILD.bazel index 7a24634a81..e46cf0c3fd 100644 --- a/codex-rs/codex-backend-openapi-models/BUILD.bazel +++ b/codex-rs/codex-backend-openapi-models/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "codex-backend-openapi-models", crate_name = "codex_backend_openapi_models", - test_sizes = { - "codex-backend-openapi-models-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/codex-experimental-api-macros/BUILD.bazel b/codex-rs/codex-experimental-api-macros/BUILD.bazel index 7794383576..370a4ed8c5 100644 --- a/codex-rs/codex-experimental-api-macros/BUILD.bazel +++ b/codex-rs/codex-experimental-api-macros/BUILD.bazel @@ -4,7 +4,4 @@ codex_rust_crate( name = "codex-experimental-api-macros", crate_name = "codex_experimental_api_macros", proc_macro = True, - test_sizes = { - "codex-experimental-api-macros-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/collaboration-mode-templates/BUILD.bazel b/codex-rs/collaboration-mode-templates/BUILD.bazel index bc4b2b3821..4e6a69f002 100644 --- a/codex-rs/collaboration-mode-templates/BUILD.bazel +++ b/codex-rs/collaboration-mode-templates/BUILD.bazel @@ -4,9 +4,6 @@ codex_rust_crate( name = "collaboration-mode-templates", compile_data = glob(["templates/*.md"]), crate_name = "codex_collaboration_mode_templates", - test_sizes = { - "collaboration-mode-templates-unit-tests-windows-cross": "medium", - }, ) exports_files( diff --git a/codex-rs/connectors/BUILD.bazel b/codex-rs/connectors/BUILD.bazel index 59c858b9d3..c4cb9ebde8 100644 --- a/codex-rs/connectors/BUILD.bazel +++ b/codex-rs/connectors/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "connectors", crate_name = "codex_connectors", - test_sizes = { - "connectors-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/context-fragments/BUILD.bazel b/codex-rs/context-fragments/BUILD.bazel index a4d5447f3f..b5920d0a23 100644 --- a/codex-rs/context-fragments/BUILD.bazel +++ b/codex-rs/context-fragments/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "context-fragments", crate_name = "codex_context_fragments", - test_sizes = { - "context-fragments-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/core-plugins/BUILD.bazel b/codex-rs/core-plugins/BUILD.bazel index f453ef702b..58503cb031 100644 --- a/codex-rs/core-plugins/BUILD.bazel +++ b/codex-rs/core-plugins/BUILD.bazel @@ -12,7 +12,4 @@ codex_rust_crate( ], ), crate_name = "codex_core_plugins", - test_sizes = { - "core-plugins-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/core-skills/BUILD.bazel b/codex-rs/core-skills/BUILD.bazel index b3775ac9c4..77c4253e73 100644 --- a/codex-rs/core-skills/BUILD.bazel +++ b/codex-rs/core-skills/BUILD.bazel @@ -12,7 +12,4 @@ codex_rust_crate( ], ), crate_name = "codex_core_skills", - test_sizes = { - "core-skills-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/core/BUILD.bazel b/codex-rs/core/BUILD.bazel index a73a1dfe8e..f55e2e1b50 100644 --- a/codex-rs/core/BUILD.bazel +++ b/codex-rs/core/BUILD.bazel @@ -48,9 +48,5 @@ codex_rust_crate( "core-unit-tests": 32, "core-unit-tests-windows-cross": 4, }, - test_sizes = { - "core-all-test-windows-cross": "medium", - "core-unit-tests-windows-cross": "medium", - }, test_tags = ["no-sandbox"], ) diff --git a/codex-rs/exec-server/BUILD.bazel b/codex-rs/exec-server/BUILD.bazel index 94b08895c4..3a59281892 100644 --- a/codex-rs/exec-server/BUILD.bazel +++ b/codex-rs/exec-server/BUILD.bazel @@ -16,8 +16,5 @@ codex_rust_crate( # 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_sizes = { - "exec-server-unit-tests-windows-cross": "medium", - }, test_tags = ["no-sandbox"], ) diff --git a/codex-rs/exec/BUILD.bazel b/codex-rs/exec/BUILD.bazel index 2a4f722156..0bb1cb73bd 100644 --- a/codex-rs/exec/BUILD.bazel +++ b/codex-rs/exec/BUILD.bazel @@ -7,8 +7,5 @@ codex_rust_crate( "exec-all-test": 16, "exec-all-test-windows-cross": 2, }, - test_sizes = { - "exec-all-test-windows-cross": "medium", - }, test_tags = ["no-sandbox"], ) diff --git a/codex-rs/features/BUILD.bazel b/codex-rs/features/BUILD.bazel index 42ed3ab397..09c03d68ec 100644 --- a/codex-rs/features/BUILD.bazel +++ b/codex-rs/features/BUILD.bazel @@ -11,7 +11,4 @@ codex_rust_crate( ], ), crate_name = "codex_features", - test_sizes = { - "features-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/file-system/BUILD.bazel b/codex-rs/file-system/BUILD.bazel index 1a851d07e2..5648036f8d 100644 --- a/codex-rs/file-system/BUILD.bazel +++ b/codex-rs/file-system/BUILD.bazel @@ -3,10 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "file-system", crate_name = "codex_file_system", - # This test is short once running, but it hit the 60s Windows timeout when - # several freshly invalidated tests launched together. Serialize local runs - # to avoid runner startup contention while keeping the small test size. - test_tags_by_target = { - "file-system-unit-tests-windows-cross": ["exclusive-if-local"], - }, ) diff --git a/codex-rs/git-utils/BUILD.bazel b/codex-rs/git-utils/BUILD.bazel index 07a3d0dc97..346fd3f8f4 100644 --- a/codex-rs/git-utils/BUILD.bazel +++ b/codex-rs/git-utils/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "git-utils", crate_name = "codex_git_utils", - test_sizes = { - "git-utils-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/keyring-store/BUILD.bazel b/codex-rs/keyring-store/BUILD.bazel index 6f05263c2a..eb0cbded94 100644 --- a/codex-rs/keyring-store/BUILD.bazel +++ b/codex-rs/keyring-store/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "keyring-store", crate_name = "codex_keyring_store", - test_sizes = { - "keyring-store-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/linux-sandbox/BUILD.bazel b/codex-rs/linux-sandbox/BUILD.bazel index 0f033c633f..2770b97e09 100644 --- a/codex-rs/linux-sandbox/BUILD.bazel +++ b/codex-rs/linux-sandbox/BUILD.bazel @@ -6,8 +6,4 @@ codex_rust_crate( extra_binaries = [ "//codex-rs/bwrap:bwrap", ], - test_sizes = { - "linux-sandbox-all-test-windows-cross": "medium", - "linux-sandbox-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/memories/read/BUILD.bazel b/codex-rs/memories/read/BUILD.bazel index ea0571c2d5..5cf6ec799b 100644 --- a/codex-rs/memories/read/BUILD.bazel +++ b/codex-rs/memories/read/BUILD.bazel @@ -3,10 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "read", crate_name = "codex_memories_read", - # This test is short once running, but it hit the 60s Windows timeout when - # several freshly invalidated tests launched together. Serialize local runs - # to avoid runner startup contention while keeping the small test size. - test_tags_by_target = { - "read-unit-tests-windows-cross": ["exclusive-if-local"], - }, ) diff --git a/codex-rs/memories/write/BUILD.bazel b/codex-rs/memories/write/BUILD.bazel index 92fb9e82c0..8670512e13 100644 --- a/codex-rs/memories/write/BUILD.bazel +++ b/codex-rs/memories/write/BUILD.bazel @@ -6,7 +6,4 @@ codex_rust_crate( "templates/**", ]), crate_name = "codex_memories_write", - test_sizes = { - "write-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/plugin/BUILD.bazel b/codex-rs/plugin/BUILD.bazel index 7236e19697..d3474aafb6 100644 --- a/codex-rs/plugin/BUILD.bazel +++ b/codex-rs/plugin/BUILD.bazel @@ -12,7 +12,4 @@ codex_rust_crate( ], ), crate_name = "codex_plugin", - test_sizes = { - "plugin-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/process-hardening/BUILD.bazel b/codex-rs/process-hardening/BUILD.bazel index e624de686d..ca657163ba 100644 --- a/codex-rs/process-hardening/BUILD.bazel +++ b/codex-rs/process-hardening/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "process-hardening", crate_name = "codex_process_hardening", - test_sizes = { - "process-hardening-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/rmcp-client/BUILD.bazel b/codex-rs/rmcp-client/BUILD.bazel index e6bb8a617e..89a1963ecc 100644 --- a/codex-rs/rmcp-client/BUILD.bazel +++ b/codex-rs/rmcp-client/BUILD.bazel @@ -6,8 +6,4 @@ codex_rust_crate( extra_binaries = [ "//codex-rs/cli:codex", ], - test_sizes = { - "rmcp-client-streamable_http_recovery-test-windows-cross": "medium", - "rmcp-client-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/rollout/BUILD.bazel b/codex-rs/rollout/BUILD.bazel index 78e9c49625..a91a3dd507 100644 --- a/codex-rs/rollout/BUILD.bazel +++ b/codex-rs/rollout/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "rollout", crate_name = "codex_rollout", - test_sizes = { - "rollout-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/secrets/BUILD.bazel b/codex-rs/secrets/BUILD.bazel index a9c47f8963..1b69e7c7e0 100644 --- a/codex-rs/secrets/BUILD.bazel +++ b/codex-rs/secrets/BUILD.bazel @@ -3,10 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "secrets", crate_name = "codex_secrets", - # This test is short once running, but it hit the 60s Windows timeout when - # several freshly invalidated tests launched together. Serialize local runs - # to avoid runner startup contention while keeping the small test size. - test_tags_by_target = { - "secrets-unit-tests-windows-cross": ["exclusive-if-local"], - }, ) diff --git a/codex-rs/shell-command/BUILD.bazel b/codex-rs/shell-command/BUILD.bazel index 5dc2e1455d..9eaa1377a1 100644 --- a/codex-rs/shell-command/BUILD.bazel +++ b/codex-rs/shell-command/BUILD.bazel @@ -4,7 +4,4 @@ codex_rust_crate( name = "shell-command", compile_data = ["src/command_safety/powershell_parser.ps1"], crate_name = "codex_shell_command", - test_sizes = { - "shell-command-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/shell-escalation/BUILD.bazel b/codex-rs/shell-escalation/BUILD.bazel index 44f7cd0410..5092f33324 100644 --- a/codex-rs/shell-escalation/BUILD.bazel +++ b/codex-rs/shell-escalation/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "shell-escalation", crate_name = "codex_shell_escalation", - test_sizes = { - "shell-escalation-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/skills/BUILD.bazel b/codex-rs/skills/BUILD.bazel index 5732d920ac..d4c5ad2675 100644 --- a/codex-rs/skills/BUILD.bazel +++ b/codex-rs/skills/BUILD.bazel @@ -12,7 +12,4 @@ codex_rust_crate( ], ), crate_name = "codex_skills", - test_sizes = { - "skills-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/state/BUILD.bazel b/codex-rs/state/BUILD.bazel index 595ebef3a5..8b7c454fdb 100644 --- a/codex-rs/state/BUILD.bazel +++ b/codex-rs/state/BUILD.bazel @@ -9,16 +9,4 @@ codex_rust_crate( "migrations/**", ]), crate_name = "codex_state", - test_sizes = { - "state-unit-tests-windows-cross": "medium", - }, - # Cold Windows runs exceed the 60s short timeout, while remote results have - # reported about 15s and made the medium budget look oversized. Run it alone - # and bypass remote test-result caching so CI measures the cold runtime. - test_tags_by_target = { - "state-unit-tests-windows-cross": [ - "exclusive-if-local", - "no-remote-cache", - ], - }, ) diff --git a/codex-rs/stdio-to-uds/BUILD.bazel b/codex-rs/stdio-to-uds/BUILD.bazel index e636446464..ed84505465 100644 --- a/codex-rs/stdio-to-uds/BUILD.bazel +++ b/codex-rs/stdio-to-uds/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "stdio-to-uds", crate_name = "codex_stdio_to_uds", - test_sizes = { - "stdio-to-uds-stdio_to_uds-test-windows-cross": "medium", - }, ) diff --git a/codex-rs/terminal-detection/BUILD.bazel b/codex-rs/terminal-detection/BUILD.bazel index 71987baa2c..a41a762c18 100644 --- a/codex-rs/terminal-detection/BUILD.bazel +++ b/codex-rs/terminal-detection/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "terminal-detection", crate_name = "codex_terminal_detection", - test_sizes = { - "terminal-detection-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/uds/BUILD.bazel b/codex-rs/uds/BUILD.bazel index 0a4ac2a8cf..a539147dd2 100644 --- a/codex-rs/uds/BUILD.bazel +++ b/codex-rs/uds/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "uds", crate_name = "codex_uds", - test_sizes = { - "uds-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/approval-presets/BUILD.bazel b/codex-rs/utils/approval-presets/BUILD.bazel index c8b68305c2..5fd4984486 100644 --- a/codex-rs/utils/approval-presets/BUILD.bazel +++ b/codex-rs/utils/approval-presets/BUILD.bazel @@ -3,10 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "approval-presets", crate_name = "codex_utils_approval_presets", - # This test is short once running, but it hit the 60s Windows timeout when - # several freshly invalidated tests launched together. Serialize local runs - # to avoid runner startup contention while keeping the small test size. - test_tags_by_target = { - "approval-presets-unit-tests-windows-cross": ["exclusive-if-local"], - }, ) diff --git a/codex-rs/utils/cache/BUILD.bazel b/codex-rs/utils/cache/BUILD.bazel index 74cfcea963..faae727403 100644 --- a/codex-rs/utils/cache/BUILD.bazel +++ b/codex-rs/utils/cache/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "cache", crate_name = "codex_utils_cache", - test_sizes = { - "cache-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/cargo-bin/BUILD.bazel b/codex-rs/utils/cargo-bin/BUILD.bazel index f4a8df845f..e4a96f5b6d 100644 --- a/codex-rs/utils/cargo-bin/BUILD.bazel +++ b/codex-rs/utils/cargo-bin/BUILD.bazel @@ -14,7 +14,4 @@ codex_rust_crate( "CODEX_REPO_ROOT_MARKER": "$(rlocationpath :repo_root.marker)", }, test_data_extra = ["repo_root.marker"], - test_sizes = { - "cargo-bin-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/elapsed/BUILD.bazel b/codex-rs/utils/elapsed/BUILD.bazel index 85a0d5d403..dcc7b206d2 100644 --- a/codex-rs/utils/elapsed/BUILD.bazel +++ b/codex-rs/utils/elapsed/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "elapsed", crate_name = "codex_utils_elapsed", - test_sizes = { - "elapsed-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/fuzzy-match/BUILD.bazel b/codex-rs/utils/fuzzy-match/BUILD.bazel index 28f49603ee..bcafc00355 100644 --- a/codex-rs/utils/fuzzy-match/BUILD.bazel +++ b/codex-rs/utils/fuzzy-match/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "fuzzy-match", crate_name = "codex_utils_fuzzy_match", - test_sizes = { - "fuzzy-match-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/image/BUILD.bazel b/codex-rs/utils/image/BUILD.bazel index b16cfe1a23..e52908524e 100644 --- a/codex-rs/utils/image/BUILD.bazel +++ b/codex-rs/utils/image/BUILD.bazel @@ -4,10 +4,10 @@ codex_rust_crate( name = "image", crate_name = "codex_utils_image", test_shard_counts = { + # The native test needs four shards to stay inside its short budget. "image-unit-tests": 4, + # Windows-cross gets a medium budget automatically and fits in one + # shard, avoiding extra local Windows process startup overhead. "image-unit-tests-windows-cross": 1, }, - test_sizes = { - "image-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/output-truncation/BUILD.bazel b/codex-rs/utils/output-truncation/BUILD.bazel index ff739fb932..eefd22ddb2 100644 --- a/codex-rs/utils/output-truncation/BUILD.bazel +++ b/codex-rs/utils/output-truncation/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "output-truncation", crate_name = "codex_utils_output_truncation", - test_sizes = { - "output-truncation-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/path-uri/BUILD.bazel b/codex-rs/utils/path-uri/BUILD.bazel index 91fe614706..7bfd2c4542 100644 --- a/codex-rs/utils/path-uri/BUILD.bazel +++ b/codex-rs/utils/path-uri/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "path-uri", crate_name = "codex_utils_path_uri", - test_sizes = { - "path-uri-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/plugins/BUILD.bazel b/codex-rs/utils/plugins/BUILD.bazel index 6d5acc87cf..273e98fc4b 100644 --- a/codex-rs/utils/plugins/BUILD.bazel +++ b/codex-rs/utils/plugins/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "plugins", crate_name = "codex_utils_plugins", - test_sizes = { - "plugins-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/rustls-provider/BUILD.bazel b/codex-rs/utils/rustls-provider/BUILD.bazel index 7d85da4261..1acae527af 100644 --- a/codex-rs/utils/rustls-provider/BUILD.bazel +++ b/codex-rs/utils/rustls-provider/BUILD.bazel @@ -3,13 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "rustls-provider", crate_name = "codex_utils_rustls_provider", - test_sizes = { - "rustls-provider-preinstalled-test-windows-cross": "medium", - }, - # This unit test is short once running, but it hit the 60s Windows timeout - # when several freshly invalidated tests launched together. Serialize local - # runs to avoid runner startup contention while keeping its small size. - test_tags_by_target = { - "rustls-provider-unit-tests-windows-cross": ["exclusive-if-local"], - }, ) diff --git a/codex-rs/utils/sleep-inhibitor/BUILD.bazel b/codex-rs/utils/sleep-inhibitor/BUILD.bazel index 665e79f3bc..4884593efe 100644 --- a/codex-rs/utils/sleep-inhibitor/BUILD.bazel +++ b/codex-rs/utils/sleep-inhibitor/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "sleep-inhibitor", crate_name = "codex_utils_sleep_inhibitor", - test_sizes = { - "sleep-inhibitor-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/stream-parser/BUILD.bazel b/codex-rs/utils/stream-parser/BUILD.bazel index 47bde97125..e94b3d7404 100644 --- a/codex-rs/utils/stream-parser/BUILD.bazel +++ b/codex-rs/utils/stream-parser/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "stream-parser", crate_name = "codex_utils_stream_parser", - test_sizes = { - "stream-parser-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/string/BUILD.bazel b/codex-rs/utils/string/BUILD.bazel index 72b68f0523..468cdf6fe7 100644 --- a/codex-rs/utils/string/BUILD.bazel +++ b/codex-rs/utils/string/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "string", crate_name = "codex_utils_string", - test_sizes = { - "string-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/utils/template/BUILD.bazel b/codex-rs/utils/template/BUILD.bazel index d29f715453..4b3376de4e 100644 --- a/codex-rs/utils/template/BUILD.bazel +++ b/codex-rs/utils/template/BUILD.bazel @@ -3,7 +3,4 @@ load("//:defs.bzl", "codex_rust_crate") codex_rust_crate( name = "template", crate_name = "codex_utils_template", - test_sizes = { - "template-unit-tests-windows-cross": "medium", - }, ) diff --git a/codex-rs/windows-sandbox-rs/BUILD.bazel b/codex-rs/windows-sandbox-rs/BUILD.bazel index d05dee7900..cb701594cc 100644 --- a/codex-rs/windows-sandbox-rs/BUILD.bazel +++ b/codex-rs/windows-sandbox-rs/BUILD.bazel @@ -6,16 +6,4 @@ codex_rust_crate( "codex-windows-sandbox-setup.manifest", ], crate_name = "codex_windows_sandbox", - test_sizes = { - "windows-sandbox-rs-unit-tests-windows-cross": "medium", - }, - # Cold Windows runs exceed the 60s short timeout, while remote results have - # reported about 3s and made the medium budget look oversized. Run it alone - # and bypass remote test-result caching so CI measures the cold runtime. - test_tags_by_target = { - "windows-sandbox-rs-unit-tests-windows-cross": [ - "exclusive-if-local", - "no-remote-cache", - ], - }, ) diff --git a/defs.bzl b/defs.bzl index ff6907dcba..f8a899b32c 100644 --- a/defs.bzl +++ b/defs.bzl @@ -35,6 +35,13 @@ WINDOWS_GNULLVM_ONLY = select({ "//conditions:default": ["@platforms//:incompatible"], }) +_NEXT_TEST_SIZE = { + "small": "medium", + "medium": "large", + "large": "enormous", + "enormous": "enormous", +} + # libwebrtc uses Objective-C categories from native archives. Any Bazel-linked # macOS binary/test that can pull it in must keep category symbols alive. MACOS_WEBRTC_RUSTC_LINK_FLAGS = select({ @@ -198,7 +205,6 @@ def codex_rust_crate( test_shard_counts = {}, test_sizes = {}, test_tags = [], - test_tags_by_target = {}, unit_test_timeout = None, extra_binaries = [], extra_binaries_non_windows = [], @@ -244,12 +250,11 @@ def codex_rust_crate( variants inherit the native target's count unless callers override the generated variant name explicitly. test_sizes: Mapping from generated test target name to Bazel test size. - All generated tests default to small. Callers can override slower - targets individually, including Windows-cross and Wine tests. + Native and Wine tests default to small. Windows-cross tests default + to one size larger than the corresponding native target, capped at + enormous. Callers can override generated targets individually. test_tags: Tags applied to unit + integration test targets. Typically used to disable the sandbox, but see https://bazel.build/reference/be/common-definitions#common.tags - test_tags_by_target: Mapping from generated test target name to - additional Bazel tags for that target. unit_test_timeout: Optional Bazel timeout for the unit-test target generated from `src/**/*.rs`. extra_binaries: Additional binary labels to surface as test data and @@ -381,7 +386,7 @@ def codex_rust_crate( test_bin = ":" + unit_test_binary, workspace_root_marker = "//codex-rs/utils/cargo-bin:repo_root.marker", target_compatible_with = target_compatible_with, - tags = _test_tags(test_tags, test_tags_by_target, unit_test_target_name), + tags = test_tags, **unit_test_kwargs ) @@ -531,7 +536,7 @@ def codex_rust_crate( test_bin = ":" + integration_test_binary, workspace_root_marker = "//codex-rs/utils/cargo-bin:repo_root.marker", target_compatible_with = WINDOWS_GNULLVM_INCOMPATIBLE, - tags = _test_tags(test_tags, test_tags_by_target, test_name), + tags = test_tags, **test_kwargs ) else: @@ -557,7 +562,7 @@ def codex_rust_crate( rustc_env = rustc_env, env = integration_test_cargo_env, target_compatible_with = WINDOWS_GNULLVM_INCOMPATIBLE, - tags = _test_tags(test_tags, test_tags_by_target, test_name), + tags = test_tags, **test_kwargs ) @@ -607,7 +612,7 @@ def codex_rust_crate( test_bin = "//codex-rs/exec-server/testing:wine-exec-test-runner", workspace_root_marker = "//codex-rs/utils/cargo-bin:repo_root.marker", target_compatible_with = WINE_TEST_TARGET_COMPATIBLE_WITH, - tags = _test_tags(test_tags, test_tags_by_target, wine_test_name) + ["manual"], + tags = test_tags + ["manual"], **wine_test_kwargs ) @@ -645,7 +650,7 @@ def codex_rust_crate( test_bin = ":" + windows_cross_test_binary, workspace_root_marker = "//codex-rs/utils/cargo-bin:repo_root.marker", target_compatible_with = WINDOWS_GNULLVM_ONLY, - tags = _test_tags(test_tags, test_tags_by_target, windows_cross_test_name), + tags = test_tags, **windows_cross_test_kwargs ) @@ -665,14 +670,6 @@ def codex_rust_crate( if unknown_test_shard_counts: fail("test_shard_counts contains unknown generated test targets: {}".format(", ".join(unknown_test_shard_counts))) - unknown_test_tags = sorted([ - test_name - for test_name in test_tags_by_target - if test_name not in generated_test_names - ]) - if unknown_test_tags: - fail("test_tags_by_target contains unknown generated test targets: {}".format(", ".join(unknown_test_tags))) - def _test_shard_count(test_shard_counts, test_name): shard_count = test_shard_counts.get(test_name) if shard_count == None: @@ -683,12 +680,17 @@ def _test_shard_count(test_shard_counts, test_name): return shard_count -def _test_tags(test_tags, test_tags_by_target, test_name): - return test_tags + test_tags_by_target.get(test_name, []) - def _test_size(test_sizes, test_name): - size = test_sizes.get(test_name, "small") - if size not in ["small", "medium", "large", "enormous"]: + size = test_sizes.get(test_name) + if size == None and test_name.endswith("-windows-cross"): + native_test_name = test_name.removesuffix("-windows-cross") + native_size = test_sizes.get(native_test_name, "small") + if native_size not in _NEXT_TEST_SIZE: + fail("test_sizes[{}] must be a valid Bazel test size".format(native_test_name)) + size = _NEXT_TEST_SIZE[native_size] + if size == None: + size = "small" + if size not in _NEXT_TEST_SIZE: fail("test_sizes[{}] must be a valid Bazel test size".format(test_name)) return size