Add non_sandbox_test helper (#3880)

Makes tests shorter
This commit is contained in:
pakrym-oai
2025-09-22 07:50:41 -07:00
committed by GitHub
parent 5996ee0e5f
commit 14a115d488
14 changed files with 99 additions and 223 deletions

View File

@@ -24,6 +24,7 @@ use tempfile::TempDir;
use tokio::time::timeout;
use wiremock::MockServer;
use core_test_support::non_sandbox_test;
use mcp_test_support::McpProcess;
use mcp_test_support::create_apply_patch_sse_response;
use mcp_test_support::create_final_assistant_message_sse_response;
@@ -307,12 +308,7 @@ async fn patch_approval_triggers_elicitation() -> anyhow::Result<()> {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_codex_tool_passes_base_instructions() {
if std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() {
println!(
"Skipping test because it cannot execute when network is disabled in a Codex sandbox."
);
return;
}
non_sandbox_test!();
// Apparently `#[tokio::test]` must return `()`, so we create a helper
// function that returns `Result` so we can use `?` in favor of `unwrap`.