From eae9cc3476891f4d729e614b9f1beb94286dda24 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Tue, 7 Jul 2026 16:22:11 +0000 Subject: [PATCH] bench: add e2e benchmark entrypoints --- codex-rs/BUILD.bazel | 9 +++++++++ justfile | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/codex-rs/BUILD.bazel b/codex-rs/BUILD.bazel index c32068a82614..1e03df292e6d 100644 --- a/codex-rs/BUILD.bazel +++ b/codex-rs/BUILD.bazel @@ -15,3 +15,12 @@ filegroup( ), visibility = ["//visibility:public"], ) + +test_suite( + name = "e2e-benchmarks", + tags = ["manual"], + tests = [ + "//codex-rs/cli:codex-help-bench", + ], + visibility = ["//visibility:public"], +) diff --git a/justfile b/justfile index d4a0e6566c67..8ef8430ffc84 100644 --- a/justfile +++ b/justfile @@ -99,6 +99,19 @@ bench *args: bench-smoke: just bench -- --test +# Run Bazel-backed end-to-end macrobenchmarks with optimized binaries. +bench-e2e: + # Keep measured binaries comparable to production-style optimized builds. + bazel test --compilation_mode=opt --cache_test_results=no --test_output=streamed //codex-rs:e2e-benchmarks + +# Run Bazel-backed end-to-end macrobenchmarks once per case with release-like +# Rust cfg paths but fastbuild codegen. +bench-e2e-smoke: + # Avoid optimizer cost because smoke runs only check that benchmarks work. + # Compile target Rust code through the same release-only cfg paths as opt. + # Compile exec-platform Rust tools through those release-only cfg paths too. + bazel test --compilation_mode=fastbuild --@rules_rust//rust/settings:extra_rustc_flag=-Cdebug-assertions=no --@rules_rust//rust/settings:extra_exec_rustc_flag=-Cdebug-assertions=no --cache_test_results=no --test_output=streamed --test_arg=--test //codex-rs:e2e-benchmarks + # Build and run Codex from source using Bazel. # On Unix, use `[no-cd]` and `--run_under="cd $PWD &&"` to ensure Bazel runs # the command in the current working directory.