From 77920ebdc668d7fa3397acc714482b2f51c67619 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:49:43 +0000 Subject: [PATCH 1/4] test: launch mock server with shebang --- tests/mocks/serve.ts | 3 +++ 1 file changed, 3 insertions(+) mode change 100644 => 100755 tests/mocks/serve.ts diff --git a/tests/mocks/serve.ts b/tests/mocks/serve.ts old mode 100644 new mode 100755 index 72d4177..998a8da --- a/tests/mocks/serve.ts +++ b/tests/mocks/serve.ts @@ -1,8 +1,11 @@ +#!/usr/bin/env 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"; From 09920176a293f6d1674603710af1f28eab152d7d Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:49:50 +0000 Subject: [PATCH 2/4] chore(flake): remove node_modules install bun install all deps automatically --- flake.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/flake.nix b/flake.nix index 509a98f..1452f6b 100644 --- a/flake.nix +++ b/flake.nix @@ -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} ''; From 0ca79d6f5e06e95f1d3f5a1f37f73ade0d8d9adf Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:53:33 +0000 Subject: [PATCH 3/4] test: remove bun install --- tests/conftest.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1ffd92b..56459bb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,6 @@ from __future__ import annotations import os -import shutil import socket import subprocess import time @@ -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, From a91681aaf887364ed13e73c87aef022e5eed66b1 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:59:40 +0000 Subject: [PATCH 4/4] fix(test): use -S flag in shebang for Linux compatibility The shebang `#!/usr/bin/env bun run` works on macOS but fails on Linux because the `env` command doesn't split space-separated arguments by default. Using `#!/usr/bin/env -S bun run` makes env parse the string as multiple arguments, enabling cross-platform compatibility. Fixes CI failures where the mock server couldn't start due to: /usr/bin/env: 'bun run': No such file or directory --- tests/mocks/serve.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mocks/serve.ts b/tests/mocks/serve.ts index 998a8da..28c3a9c 100755 --- a/tests/mocks/serve.ts +++ b/tests/mocks/serve.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env bun run +#!/usr/bin/env -S bun run /** * Standalone HTTP server for MCP mock testing. * Imports createMcpApp from stackone-ai-node vendor submodule.