test: Fix test networking
This commit is contained in:
@@ -62,4 +62,4 @@ jobs:
|
||||
NEXTCLOUD_USERNAME: "admin"
|
||||
NEXTCLOUD_PASSWORD: "admin"
|
||||
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'
|
||||
|
||||
@@ -39,6 +39,8 @@ services:
|
||||
- MYSQL_DATABASE=nextcloud
|
||||
- MYSQL_USER=nextcloud
|
||||
- MYSQL_HOST=db
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
mcp:
|
||||
build: .
|
||||
|
||||
@@ -161,16 +161,8 @@ async def test_cookbook_import_recipe_from_url(
|
||||
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.
|
||||
"""
|
||||
# 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)
|
||||
test_url = f"{docker_accessible_url}/black-pepper-tofu"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import platform
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
@@ -216,11 +215,7 @@ async def test_mcp_cookbook_import_recipe_from_url(
|
||||
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.
|
||||
"""
|
||||
# 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)
|
||||
test_url = f"{docker_accessible_url}/black-pepper-tofu"
|
||||
|
||||
Reference in New Issue
Block a user