mirror of
https://github.com/openai/codex.git
synced 2026-04-26 15:45:02 +00:00
Migrate prompt caching tests to test_codex (#6605)
To hopefully fix the flakiness
This commit is contained in:
@@ -71,6 +71,7 @@ impl TestCodexBuilder {
|
||||
resume_from: Option<PathBuf>,
|
||||
) -> anyhow::Result<TestCodex> {
|
||||
let (config, cwd) = self.prepare_config(server, &home).await?;
|
||||
|
||||
let conversation_manager = ConversationManager::with_auth(CodexAuth::from_api_key("dummy"));
|
||||
|
||||
let new_conversation = match resume_from {
|
||||
@@ -79,15 +80,20 @@ impl TestCodexBuilder {
|
||||
CodexAuth::from_api_key("dummy"),
|
||||
);
|
||||
conversation_manager
|
||||
.resume_conversation_from_rollout(config, path, auth_manager)
|
||||
.resume_conversation_from_rollout(config.clone(), path, auth_manager)
|
||||
.await?
|
||||
}
|
||||
None => {
|
||||
conversation_manager
|
||||
.new_conversation(config.clone())
|
||||
.await?
|
||||
}
|
||||
None => conversation_manager.new_conversation(config).await?,
|
||||
};
|
||||
|
||||
Ok(TestCodex {
|
||||
home,
|
||||
cwd,
|
||||
config,
|
||||
codex: new_conversation.conversation,
|
||||
session_configured: new_conversation.session_configured,
|
||||
})
|
||||
@@ -131,6 +137,7 @@ pub struct TestCodex {
|
||||
pub cwd: Arc<TempDir>,
|
||||
pub codex: Arc<CodexConversation>,
|
||||
pub session_configured: SessionConfiguredEvent,
|
||||
pub config: Config,
|
||||
}
|
||||
|
||||
impl TestCodex {
|
||||
|
||||
Reference in New Issue
Block a user