Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@
uv sync --all-extras
fi

# Install Node.js dependencies for MCP mock server (used in tests)
if [ -f vendor/stackone-ai-node/package.json ]; then
if [ ! -f vendor/stackone-ai-node/node_modules/.pnpm/lock.yaml ] || \
[ vendor/stackone-ai-node/pnpm-lock.yaml -nt vendor/stackone-ai-node/node_modules/.pnpm/lock.yaml ]; then
echo "📦 Installing MCP mock server dependencies..."
(cd vendor/stackone-ai-node && pnpm install --frozen-lockfile)
fi
fi

# Install git hooks
${config.pre-commit.installationScript}
'';
Expand Down
19 changes: 2 additions & 17 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import os
import shutil
import socket
import subprocess
import time
Expand Down Expand Up @@ -61,30 +60,16 @@ def test_mcp_integration(mcp_mock_server):
if not vendor_dir.exists():
pytest.skip("stackone-ai-node submodule not found. Run 'git submodule update --init'")

# Check for bun runtime
bun_path = shutil.which("bun")
if not bun_path:
pytest.skip("bun not found. Install via Nix flake.")

# find port
port = _find_free_port()
base_url = f"http://localhost:{port}"

# Install dependencies if needed
node_modules = vendor_dir / "node_modules"
if not node_modules.exists():
subprocess.run(
[bun_path, "install"],
cwd=vendor_dir,
check=True,
capture_output=True,
)

# Start the server from project root
env = os.environ.copy()
env["PORT"] = str(port)

process = subprocess.Popen(
[bun_path, "run", str(serve_script)],
[str(serve_script)],
cwd=project_root,
env=env,
stdout=subprocess.PIPE,
Expand Down
3 changes: 3 additions & 0 deletions tests/mocks/serve.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env -S bun run
/**
* Standalone HTTP server for MCP mock testing.
* Imports createMcpApp from stackone-ai-node vendor submodule.
*
* Usage:
* ./tests/mocks/serve.ts [port]
* # or
* bun run tests/mocks/serve.ts [port]
*/
import { Hono } from "hono";
Expand Down