Skip to content

Commit 8780698

Browse files
authored
fix: Temporarily disable brave search mcp integration test (#2187)
* Disable brave search temporarily, keeps returning no results found
1 parent 881406a commit 8780698

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

integrations/mcp/tests/test_mcp_integration.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,7 @@ def subtract(a: int, b: int) -> int:
135135
if os.path.exists(server_script_path):
136136
os.remove(server_script_path)
137137

138-
@pytest.mark.skipif(
139-
(not os.environ.get("OPENAI_API_KEY") and not os.environ.get("BRAVE_API_KEY"))
140-
or (sys.platform == "win32")
141-
or (sys.platform == "darwin"),
142-
reason="OPENAI_API_KEY or BRAVE_API_KEY not set, or running on Windows or macOS",
143-
)
138+
@pytest.mark.skip("Brave is temporarily not returning results")
144139
def test_mcp_brave_search(self, mcp_tool_cleanup):
145140
"""Test using an MCPTool in a pipeline with OpenAI."""
146141

@@ -165,14 +160,16 @@ def test_mcp_brave_search(self, mcp_tool_cleanup):
165160

166161
# Create pipeline with OpenAIChatGenerator and ToolInvoker
167162
pipeline = Pipeline()
168-
pipeline.add_component("llm", OpenAIChatGenerator(model="gpt-4o-mini", tools=[tool]))
163+
pipeline.add_component("llm", OpenAIChatGenerator(model="gpt-4.1-mini", tools=[tool]))
169164
pipeline.add_component("tool_invoker", ToolInvoker(tools=[tool]))
170165

171166
# Connect components
172167
pipeline.connect("llm.replies", "tool_invoker.messages")
173168

174169
# Create a message that should trigger tool use
175-
message = ChatMessage.from_user(text="Use brave_web_search to search for the latest German elections news")
170+
message = ChatMessage.from_user(
171+
text="Use brave_web_search to search for the latest news about the stock market, use the `query` parameter"
172+
)
176173

177174
result = pipeline.run({"llm": {"messages": [message]}})
178175

@@ -181,10 +178,10 @@ def test_mcp_brave_search(self, mcp_tool_cleanup):
181178

182179
tool_message = tool_messages[0]
183180
assert tool_message.is_from(ChatRole.TOOL)
184-
assert any(term in tool_message.tool_call_result.result for term in ["Bundestag", "election"]), (
185-
"Result should contain information about German elections"
186-
f"\n\nResult: {tool_message.tool_call_result.result}"
187-
)
181+
assert any(
182+
term in tool_message.tool_call_result.result
183+
for term in ["equity", "market", "stock", "price", "NASDAQ", "S&P 500"]
184+
), f"Result should contain information about the stock market\n\nResult: {tool_message.tool_call_result.result}"
188185

189186
@pytest.mark.skipif(not os.environ.get("OPENAI_API_KEY"), reason="OPENAI_API_KEY not set")
190187
def test_mcp_tool_in_pipeline_with_multiple_tools(self, mcp_tool_cleanup):
@@ -211,7 +208,7 @@ def test_mcp_tool_in_pipeline_with_multiple_tools(self, mcp_tool_cleanup):
211208

212209
# Create pipeline with OpenAIChatGenerator and ToolInvoker
213210
pipeline = Pipeline()
214-
pipeline.add_component("llm", OpenAIChatGenerator(model="gpt-4o-mini", tools=[echo_tool, time_tool]))
211+
pipeline.add_component("llm", OpenAIChatGenerator(model="gpt-4.1-mini", tools=[echo_tool, time_tool]))
215212
pipeline.add_component("tool_invoker", ToolInvoker(tools=[echo_tool, time_tool]))
216213

217214
pipeline.connect("llm.replies", "tool_invoker.messages")

0 commit comments

Comments
 (0)