feat: add test isolation scripts with dynamic port discovery
- Add get-test-instance-id.sh for branch-based container isolation - Add run-integration-tests.sh for full test lifecycle management - Update integration tests to read service URLs from environment variables (GRIST_MCP_URL, MOCK_GRIST_URL) with fallback defaults
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
"""Fixtures for integration tests."""
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
|
||||
GRIST_MCP_URL = "http://localhost:3000"
|
||||
MOCK_GRIST_URL = "http://localhost:8484"
|
||||
GRIST_MCP_URL = os.environ.get("GRIST_MCP_URL", "http://localhost:3000")
|
||||
MOCK_GRIST_URL = os.environ.get("MOCK_GRIST_URL", "http://localhost:8484")
|
||||
MAX_WAIT_SECONDS = 30
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Test MCP protocol compliance over SSE transport."""
|
||||
|
||||
import os
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import pytest
|
||||
@@ -7,7 +8,7 @@ from mcp import ClientSession
|
||||
from mcp.client.sse import sse_client
|
||||
|
||||
|
||||
GRIST_MCP_URL = "http://localhost:3000"
|
||||
GRIST_MCP_URL = os.environ.get("GRIST_MCP_URL", "http://localhost:3000")
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Test tool calls through MCP client to verify Grist API interactions."""
|
||||
|
||||
import json
|
||||
import os
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import httpx
|
||||
@@ -9,8 +10,8 @@ from mcp import ClientSession
|
||||
from mcp.client.sse import sse_client
|
||||
|
||||
|
||||
GRIST_MCP_URL = "http://localhost:3000"
|
||||
MOCK_GRIST_URL = "http://localhost:8484"
|
||||
GRIST_MCP_URL = os.environ.get("GRIST_MCP_URL", "http://localhost:3000")
|
||||
MOCK_GRIST_URL = os.environ.get("MOCK_GRIST_URL", "http://localhost:8484")
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
|
||||
Reference in New Issue
Block a user