From 13c9bff05053303d4b147d33cebd128492b48c05 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Thu, 8 May 2025 13:08:58 +0800 Subject: [PATCH] test: add MCP test `test_fetch_mcp_via_stdio` back in CI (#8344) --- openhands/runtime/utils/runtime_templates/Dockerfile.j2 | 4 +++- tests/runtime/test_mcp_action.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openhands/runtime/utils/runtime_templates/Dockerfile.j2 b/openhands/runtime/utils/runtime_templates/Dockerfile.j2 index b0c08560c2..d192c180ab 100644 --- a/openhands/runtime/utils/runtime_templates/Dockerfile.j2 +++ b/openhands/runtime/utils/runtime_templates/Dockerfile.j2 @@ -38,7 +38,9 @@ RUN ln -s "$(dirname $(which node))/corepack" /usr/local/bin/corepack && \ {% endif %} # Install uv (required by MCP) -RUN curl -LsSf https://astral.sh/uv/install.sh | sh +RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/openhands/bin" sh +# Add /openhands/bin to PATH +ENV PATH="/openhands/bin:${PATH}" # Remove UID 1000 named pn or ubuntu, so the 'openhands' user can be created from ubuntu hosts RUN (if getent passwd 1000 | grep -q pn; then userdel pn; fi) && \ diff --git a/tests/runtime/test_mcp_action.py b/tests/runtime/test_mcp_action.py index cc25e090c8..b16c37ac7d 100644 --- a/tests/runtime/test_mcp_action.py +++ b/tests/runtime/test_mcp_action.py @@ -35,7 +35,6 @@ def test_default_activated_tools(): @pytest.mark.asyncio async def test_fetch_mcp_via_stdio(temp_dir, runtime_cls, run_as_openhands): - pytest.skip('This test is currently failing on main') mcp_stdio_server_config = MCPStdioServerConfig( name='fetch', command='uvx', args=['mcp-server-fetch'] )