## Summary - replace manual wiremock SSE mounts in the compact suite with the shared response helpers - simplify the exec auth_env integration test by using the mount_sse_once_match helper - rely on mount_sse_sequence plus server request collection to replace the bespoke SeqResponder utility in tests ## Testing - just fmt ------ https://chatgpt.com/codex/tasks/task_i_68e2e238f2a88320a337f0b9e4098093
31 lines
928 B
Rust
31 lines
928 B
Rust
#![allow(clippy::unwrap_used, clippy::expect_used)]
|
|
use core_test_support::responses::ev_completed;
|
|
use core_test_support::responses::mount_sse_once_match;
|
|
use core_test_support::responses::sse;
|
|
use core_test_support::responses::start_mock_server;
|
|
use core_test_support::test_codex_exec::test_codex_exec;
|
|
use wiremock::matchers::header;
|
|
|
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
|
async fn exec_uses_codex_api_key_env_var() -> anyhow::Result<()> {
|
|
let test = test_codex_exec();
|
|
let server = start_mock_server().await;
|
|
|
|
mount_sse_once_match(
|
|
&server,
|
|
header("Authorization", "Bearer dummy"),
|
|
sse(vec![ev_completed("request_0")]),
|
|
)
|
|
.await;
|
|
|
|
test.cmd_with_server(&server)
|
|
.arg("--skip-git-repo-check")
|
|
.arg("-C")
|
|
.arg(env!("CARGO_MANIFEST_DIR"))
|
|
.arg("echo testing codex api key")
|
|
.assert()
|
|
.success();
|
|
|
|
Ok(())
|
|
}
|