Files
codex/codex-rs/cli/src/exec_server_args_tests.rs
T
Dmitriy Kovalenko a9ea49e78b Add a standalone codex-exec-server executable (#57589)
## What changed

Extract executor startup into `codex-exec-server-cli`, shared by `codex exec-server` and the new standalone binary. Preserve executor arguments, authentication, configuration overrides, and sandbox helper dispatch across both entry points.

Build the standalone binary with `cargo build -p codex-exec-server-cli --bin codex-exec-server` and run it with `codex-exec-server --listen stdio`.

## Testing

Add standalone CLI parsing and help coverage, plus an integration test for version reporting, stdio initialization, filesystem reads, process execution, and sandbox helper re-execution when supported.

GitOrigin-RevId: ab3a81c6b91b6f45e4d72d8add2e01af8372e97f
2026-10-27 23:13:53 +00:00

30 lines
905 B
Rust

#![cfg(test)]
use super::*;
use clap::error::ErrorKind;
use pretty_assertions::assert_eq;
#[test]
fn exec_server_help_documents_remote_options() {
let command = MultitoolCli::command()
.term_width(80)
.mut_subcommand("exec-server", |command| {
command
.mut_arg("exit_on_stdin_close", |arg| arg.hide_env_values(true))
.mut_arg("proxy_private_ips_via_upstream", |arg| {
arg.hide_env_values(true)
})
});
let help = command
.try_get_matches_from(["codex", "exec-server", "--help"])
.expect_err("help should exit before running the executor");
assert_eq!(help.kind(), ErrorKind::DisplayHelp);
let help_text = help
.to_string()
.lines()
.map(str::trim_end)
.collect::<Vec<_>>()
.join("\n");
insta::assert_snapshot!(help_text);
}