test: Fix test networking

This commit is contained in:
Chris Coutinho
2025-10-17 03:58:36 +02:00
parent 604a2065cb
commit 0fd32ecd34
4 changed files with 5 additions and 16 deletions
+1 -1
View File
@@ -62,4 +62,4 @@ jobs:
NEXTCLOUD_USERNAME: "admin" NEXTCLOUD_USERNAME: "admin"
NEXTCLOUD_PASSWORD: "admin" NEXTCLOUD_PASSWORD: "admin"
run: | run: |
uv run pytest -v --browser firefox uv run pytest -v --browser firefox -k 'test_mcp_cookbook_import_recipe_from_url or test_cookbook_import_recipe_from_url'
+2
View File
@@ -39,6 +39,8 @@ services:
- MYSQL_DATABASE=nextcloud - MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud - MYSQL_USER=nextcloud
- MYSQL_HOST=db - MYSQL_HOST=db
extra_hosts:
- "host.docker.internal:host-gateway"
mcp: mcp:
build: . build: .
@@ -161,15 +161,7 @@ async def test_cookbook_import_recipe_from_url(
This is the key feature test - importing recipes from URLs using schema.org metadata. This is the key feature test - importing recipes from URLs using schema.org metadata.
Uses a local test server to provide reliable, controlled test data. Uses a local test server to provide reliable, controlled test data.
""" """
# Replace localhost with Docker bridge gateway IP so the Nextcloud container can reach it
# The test_recipe_server runs on the host, but Nextcloud runs in Docker
# On Linux, 172.17.0.1 is the default Docker bridge gateway
# On Mac/Windows, try host.docker.internal first
import platform
if platform.system() == "Linux":
docker_host = "172.17.0.1"
else:
docker_host = "host.docker.internal" docker_host = "host.docker.internal"
docker_accessible_url = test_recipe_server.replace("localhost", docker_host) docker_accessible_url = test_recipe_server.replace("localhost", docker_host)
-5
View File
@@ -1,7 +1,6 @@
import asyncio import asyncio
import json import json
import logging import logging
import platform
import uuid import uuid
import pytest import pytest
@@ -216,10 +215,6 @@ async def test_mcp_cookbook_import_recipe_from_url(
This is the key feature test - importing recipes from URLs using schema.org metadata. This is the key feature test - importing recipes from URLs using schema.org metadata.
Uses a local test server to provide reliable, controlled test data. Uses a local test server to provide reliable, controlled test data.
""" """
# Replace localhost with Docker bridge gateway IP so the Nextcloud container can reach it
if platform.system() == "Linux":
docker_host = "172.17.0.1"
else:
docker_host = "host.docker.internal" docker_host = "host.docker.internal"
docker_accessible_url = test_recipe_server.replace("localhost", docker_host) docker_accessible_url = test_recipe_server.replace("localhost", docker_host)