mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
patch stale tests
This commit is contained in:
@@ -140,7 +140,12 @@ async fn user_turn_tracks_turn_metadata_analytics() -> anyhow::Result<()> {
|
||||
)
|
||||
.await;
|
||||
|
||||
let mut builder = test_codex().with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing());
|
||||
let chatgpt_base_url = server.uri();
|
||||
let mut builder = test_codex()
|
||||
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
|
||||
.with_config(move |config| {
|
||||
config.chatgpt_base_url = chatgpt_base_url;
|
||||
});
|
||||
let TestCodex {
|
||||
codex,
|
||||
session_configured,
|
||||
|
||||
@@ -381,7 +381,14 @@ async fn explicit_plugin_mentions_track_plugin_used_analytics() -> Result<()> {
|
||||
|
||||
let payload: serde_json::Value =
|
||||
serde_json::from_slice(&analytics_request.body).expect("analytics payload");
|
||||
let event = &payload["events"][0];
|
||||
let event = payload["events"]
|
||||
.as_array()
|
||||
.and_then(|events| {
|
||||
events
|
||||
.iter()
|
||||
.find(|event| event["event_type"] == "codex_plugin_used")
|
||||
})
|
||||
.expect("codex_plugin_used event should be present");
|
||||
assert_eq!(event["event_type"], "codex_plugin_used");
|
||||
assert_eq!(event["event_params"]["plugin_id"], "sample@test");
|
||||
assert_eq!(event["event_params"]["plugin_name"], "sample");
|
||||
|
||||
Reference in New Issue
Block a user