Lightweight coding agent that runs in your terminal
Rust
Use a dedicated mock server in the provider enforcement test (#45517)
zm-oai280c7e1e5649
diff --git a/codex-rs/app-server/tests/suite/v2/model_provider_enforcement_tests.rs b/codex-rs/app-server/tests/suite/v2/model_provider_enforcement_tests.rsindex 6b2f5f8e3c..a0b3f772af 100644--- a/codex-rs/app-server/tests/suite/v2/model_provider_enforcement_tests.rs+++ b/codex-rs/app-server/tests/suite/v2/model_provider_enforcement_tests.rs@@ -60,7 +60,8 @@ async fn provider_requirement_changes_reject_inputs_to_existing_threads(},]]).await;- let other = MockServer::start().await;+ // Use a dedicated server because this test asserts that no traffic reaches it.+ let other = MockServer::builder().start().await;let home = TempDir::new()?;MockResponsesConfig::new(gateway.uri()).enable_feature(codex_features::Feature::Goals)@@ -245,12 +246,14 @@ base_url = "{}/v1"assert_eq!(error.error, expected_error);}assert_eq!(gateway.requests().await.len(), 1);+ let other_requests = other.received_requests().await.expect("recorded requests");assert!(- other- .received_requests()- .await- .expect("recorded requests")- .is_empty()+ other_requests.is_empty(),+ "unexpected requests to replacement provider: {:?}",+ other_requests+ .iter()+ .map(|request| (request.method.as_str(), request.url.path()))+ .collect::<Vec<_>>());gateway.shutdown().await;Ok(())