From ed835a1ec3a34b6dccc4a047c352c627869cb057 Mon Sep 17 00:00:00 2001 From: celia-oai Date: Wed, 8 Jul 2026 17:42:34 -0700 Subject: [PATCH] app-server: migrate Bedrock logout tests to builder --- codex-rs/app-server/tests/suite/v2/account.rs | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/codex-rs/app-server/tests/suite/v2/account.rs b/codex-rs/app-server/tests/suite/v2/account.rs index 1f85ea66c4..4e69e56db7 100644 --- a/codex-rs/app-server/tests/suite/v2/account.rs +++ b/codex-rs/app-server/tests/suite/v2/account.rs @@ -1291,8 +1291,12 @@ async fn logout_managed_bedrock_restores_default_account() -> Result<()> { .expect("config should be a table") .remove("model_provider"); - let mut mcp = - TestAppServer::new_with_env(codex_home.path(), &[("OPENAI_API_KEY", None)]).await?; + let mut mcp = TestAppServer::builder() + .with_codex_home(codex_home.path()) + .without_auto_env() + .with_env_overrides(&[("OPENAI_API_KEY", None)]) + .build() + .await?; timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??; let request_id = mcp .send_login_account_amazon_bedrock_request("managed-bedrock-api-key", "us-west-2") @@ -1358,8 +1362,12 @@ async fn logout_aws_managed_bedrock_preserves_openai_auth_and_config() -> Result let expected_auth = load_file_auth(codex_home.path())?; let expected_config = read_config_toml(codex_home.path())?; - let mut mcp = - TestAppServer::new_with_env(codex_home.path(), &[("OPENAI_API_KEY", None)]).await?; + let mut mcp = TestAppServer::builder() + .with_codex_home(codex_home.path()) + .without_auto_env() + .with_env_overrides(&[("OPENAI_API_KEY", None)]) + .build() + .await?; timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??; let request_id = mcp.send_logout_account_request().await?; let response = timeout( @@ -1390,7 +1398,11 @@ async fn logout_managed_bedrock_preserves_changed_provider_without_experimental_ AuthKeyringBackendKind::default(), )?; - let mut mcp = TestAppServer::new(codex_home.path()).await?; + let mut mcp = TestAppServer::builder() + .with_codex_home(codex_home.path()) + .without_auto_env() + .build() + .await?; let initialized = mcp .initialize_with_capabilities( ClientInfo {