mirror of
https://github.com/openai/codex.git
synced 2026-09-09 15:58:47 +00:00
Fix marketplace source test regressions
This commit is contained in:
@@ -10,7 +10,8 @@ use tempfile::TempDir;
|
||||
use tokio::time::Duration;
|
||||
use tokio::time::timeout;
|
||||
|
||||
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
const INIT_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
const REQUEST_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
#[tokio::test]
|
||||
async fn marketplace_add_local_directory_source() -> Result<()> {
|
||||
@@ -28,7 +29,7 @@ async fn marketplace_add_local_directory_source() -> Result<()> {
|
||||
)?;
|
||||
std::fs::write(source.join("plugins/sample/marker.txt"), "local ref")?;
|
||||
let mut mcp = McpProcess::new(codex_home.path()).await?;
|
||||
timeout(DEFAULT_TIMEOUT, mcp.initialize()).await??;
|
||||
timeout(INIT_TIMEOUT, mcp.initialize()).await??;
|
||||
|
||||
let request_id = mcp
|
||||
.send_marketplace_add_request(MarketplaceAddParams {
|
||||
@@ -39,7 +40,7 @@ async fn marketplace_add_local_directory_source() -> Result<()> {
|
||||
.await?;
|
||||
|
||||
let response: JSONRPCResponse = timeout(
|
||||
DEFAULT_TIMEOUT,
|
||||
REQUEST_TIMEOUT,
|
||||
mcp.read_stream_until_response_message(RequestId::Integer(request_id)),
|
||||
)
|
||||
.await??;
|
||||
|
||||
@@ -126,10 +126,10 @@ fn normalize_git_url(url: &str) -> String {
|
||||
fn looks_like_local_path(source: &str) -> bool {
|
||||
source.starts_with("./")
|
||||
|| source.starts_with("../")
|
||||
|| source.starts_with('/')
|
||||
|| source.starts_with("~/")
|
||||
|| source == "."
|
||||
|| source == ".."
|
||||
|| Path::new(source).is_absolute()
|
||||
}
|
||||
|
||||
fn resolve_local_source_path(source: &str) -> Result<PathBuf, MarketplaceAddError> {
|
||||
|
||||
@@ -3,4 +3,5 @@ load("//:defs.bzl", "codex_rust_crate")
|
||||
codex_rust_crate(
|
||||
name = "sandbox-summary",
|
||||
crate_name = "codex_utils_sandbox_summary",
|
||||
unit_test_timeout = "short",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user