Files
codex/bazel/rules/testing/compat/exec_server_compat_test.bzl
Adam Perry @ OpenAI 62aacbb2c9 Run exec-server compatibility tests under Bazel (#40736)
## What changed

- Add a Bazel test rule that runs the shared Noise relay compatibility suite with current or packaged Codex binaries.
- Cover both app-server/exec-server directions for the current build, release `0.149.1`, and the minimum supported release `0.145.0` on Linux x86-64.
- Remove the standalone version-skew download scripts and the protocol constant they used.

## Testing

The new `exec-server-current-version-test`, `exec-server-stable-release-test`, and `exec-server-minimum-release-test` targets exercise the compatibility suite.

GitOrigin-RevId: 6b3b91eea8e05a38bec1fac128afc54f0d654014
2026-08-25 23:38:49 +00:00

48 lines
1.8 KiB
Python

"""Bazel coverage for app-server and exec-server release compatibility."""
load("//:defs.bzl", "workspace_root_test")
def exec_server_compat_test(
name,
comparison_binary = None,
current_binary = "//codex-rs/cli:codex",
release = None):
"""Tests both executor directions against another Codex build or release.
Args:
name: Name of the generated compatibility test target.
comparison_binary: Built Codex executable to compare with the current build.
current_binary: Built Codex executable representing the current version.
release: External release repository exposing `:codex` and `:package`.
"""
if (comparison_binary == None) == (release == None):
fail("exactly one of comparison_binary and release must be set")
comparison = comparison_binary if release == None else release + "//:codex"
data = [] if release == None else [release + "//:package"]
comparison_alias = name + "-comparison-binary"
native.alias(
name = comparison_alias,
actual = comparison,
tags = ["manual"],
visibility = ["//visibility:private"],
)
workspace_root_test(
name = name,
args = ["--test-threads=1"],
data = data,
runfile_env = {
"//codex-rs/bwrap:bwrap": "CARGO_BIN_EXE_bwrap",
current_binary: "CODEX_TEST_CURRENT_CODEX",
":" + comparison_alias: "CODEX_TEST_RELEASED_CODEX",
},
tags = ["no-sandbox"],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
test_bin = "//bazel/rules/testing/compat:exec-server-compat-test-bin",
workspace_root_marker = "//codex-rs/utils/cargo-bin:repo_root.marker",
)