fixed test compilation on main branch (#6512)
This commit is contained in:
@@ -925,9 +925,13 @@ mod tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_record_result_outputs_valid_json() {
|
async fn test_record_result_outputs_valid_json() {
|
||||||
|
let temp_dir = tempfile::tempdir().unwrap();
|
||||||
|
let session_manager = Arc::new(crate::session::SessionManager::new(
|
||||||
|
temp_dir.path().to_path_buf(),
|
||||||
|
));
|
||||||
let context = PlatformExtensionContext {
|
let context = PlatformExtensionContext {
|
||||||
session_id: None,
|
|
||||||
extension_manager: None,
|
extension_manager: None,
|
||||||
|
session_manager,
|
||||||
};
|
};
|
||||||
let client = CodeExecutionClient::new(context).unwrap();
|
let client = CodeExecutionClient::new(context).unwrap();
|
||||||
|
|
||||||
@@ -939,7 +943,12 @@ mod tests {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let result = client
|
let result = client
|
||||||
.call_tool("execute_code", Some(args), CancellationToken::new())
|
.call_tool(
|
||||||
|
"execute_code",
|
||||||
|
Some(args),
|
||||||
|
McpMeta::new("test-session-id"),
|
||||||
|
CancellationToken::new(),
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -16,6 +16,7 @@ SCRIPT_DIR=$(pwd)
|
|||||||
|
|
||||||
JUDGE_PROVIDER=${GOOSE_JUDGE_PROVIDER:-openrouter}
|
JUDGE_PROVIDER=${GOOSE_JUDGE_PROVIDER:-openrouter}
|
||||||
JUDGE_MODEL=${GOOSE_JUDGE_MODEL:-google/gemini-2.5-flash}
|
JUDGE_MODEL=${GOOSE_JUDGE_MODEL:-google/gemini-2.5-flash}
|
||||||
|
MCP_SAMPLING_TOOL="trigger-sampling-request"
|
||||||
|
|
||||||
PROVIDERS=(
|
PROVIDERS=(
|
||||||
#"google:gemini-2.5-pro"
|
#"google:gemini-2.5-pro"
|
||||||
@@ -52,9 +53,9 @@ for provider_config in "${PROVIDERS[@]}"; do
|
|||||||
echo "Model: ${MODEL}"
|
echo "Model: ${MODEL}"
|
||||||
echo ""
|
echo ""
|
||||||
TMPFILE=$(mktemp)
|
TMPFILE=$(mktemp)
|
||||||
(cd "$TESTDIR" && "$SCRIPT_DIR/target/release/goose" run --text "Use the sampleLLM tool to ask for a quote from The Great Gatsby" --with-extension "npx -y @modelcontextprotocol/server-everything" 2>&1) | tee "$TMPFILE"
|
(cd "$TESTDIR" && "$SCRIPT_DIR/target/release/goose" run --text "Use the sampleLLM tool to ask for a quote from The Great Gatsby" --with-extension "npx -y @modelcontextprotocol/server-everything@2026.1.14" 2>&1) | tee "$TMPFILE"
|
||||||
echo ""
|
echo ""
|
||||||
if grep -q "sampleLLM | " "$TMPFILE"; then
|
if grep -q "$MCP_SAMPLING_TOOL | " "$TMPFILE"; then
|
||||||
|
|
||||||
JUDGE_PROMPT=$(cat <<EOF
|
JUDGE_PROMPT=$(cat <<EOF
|
||||||
You are a validator. You will be given a transcript of a CLI run that used an MCP tool to initiate MCP sampling.
|
You are a validator. You will be given a transcript of a CLI run that used an MCP tool to initiate MCP sampling.
|
||||||
@@ -93,7 +94,7 @@ EOF
|
|||||||
RESULTS+=("✗ MCP Sampling ${PROVIDER}: ${MODEL}")
|
RESULTS+=("✗ MCP Sampling ${PROVIDER}: ${MODEL}")
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "✗ FAILED: MCP sampling test failed - sampleLLM tool not called"
|
echo "✗ FAILED: MCP sampling test failed - $MCP_SAMPLING_TOOL tool not called"
|
||||||
RESULTS+=("✗ MCP Sampling ${PROVIDER}: ${MODEL}")
|
RESULTS+=("✗ MCP Sampling ${PROVIDER}: ${MODEL}")
|
||||||
fi
|
fi
|
||||||
rm "$TMPFILE"
|
rm "$TMPFILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user