Skip to content

Commit 7918188

Browse files
authored
fix(ci): enable responses tests in CI; suppress expected MCP auth error logs (#3889)
Let us enable responses suite in CI now. Also a minor fix: MCP tool tests intentionally trigger authentication failures to verify error handling, but the resulting error logs clutter test output.
1 parent 7b90e0e commit 7918188

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
&& fromJSON('[{"setup": "vllm", "suite": "base"}]')
6262
|| github.event.inputs.test-setup == 'ollama-vision'
6363
&& fromJSON('[{"setup": "ollama-vision", "suite": "vision"}]')
64-
|| fromJSON('[{"setup": "ollama", "suite": "base"}, {"setup": "ollama-vision", "suite": "vision"}]')
64+
|| fromJSON('[{"setup": "ollama", "suite": "base"}, {"setup": "ollama-vision", "suite": "vision"}, {"setup": "gpt", "suite": "responses"}]')
6565
}}
6666
6767
steps:

tests/integration/responses/test_tool_responses.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# the root directory of this source tree.
66

77
import json
8+
import logging # allow-direct-logging
89
import os
910

1011
import httpx
@@ -198,7 +199,7 @@ def test_response_sequential_file_search(
198199

199200

200201
@pytest.mark.parametrize("case", mcp_tool_test_cases)
201-
def test_response_non_streaming_mcp_tool(compat_client, text_model_id, case):
202+
def test_response_non_streaming_mcp_tool(compat_client, text_model_id, case, caplog):
202203
if not isinstance(compat_client, LlamaStackAsLibraryClient):
203204
pytest.skip("in-process MCP server is only supported in library client")
204205

@@ -245,13 +246,17 @@ def test_response_non_streaming_mcp_tool(compat_client, text_model_id, case):
245246
if isinstance(compat_client, LlamaStackAsLibraryClient)
246247
else (httpx.HTTPStatusError, openai.AuthenticationError)
247248
)
248-
with pytest.raises(exc_type):
249-
compat_client.responses.create(
250-
model=text_model_id,
251-
input=case.input,
252-
tools=tools,
253-
stream=False,
254-
)
249+
# Suppress expected auth error logs only for the failing auth attempt
250+
with caplog.at_level(
251+
logging.CRITICAL, logger="llama_stack.providers.inline.agents.meta_reference.responses.streaming"
252+
):
253+
with pytest.raises(exc_type):
254+
compat_client.responses.create(
255+
model=text_model_id,
256+
input=case.input,
257+
tools=tools,
258+
stream=False,
259+
)
255260

256261
for tool in tools:
257262
if tool["type"] == "mcp":

0 commit comments

Comments
 (0)