mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
## 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
30 lines
905 B
Rust
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);
|
|
}
|