Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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 bun run
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shebang is incorrect. The env command doesn't support passing arguments like this - it will look for a binary called "bun run" instead of executing "bun" with "run" as an argument. The correct shebang should be #!/usr/bin/env bun since bun can execute TypeScript files directly without needing the "run" subcommand in the shebang.

Suggested change
#!/usr/bin/env bun run
#!/usr/bin/env bun

Copilot uses AI. Check for mistakes.
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The shebang #!/usr/bin/env bun run is non-portable. POSIX env doesn't reliably handle multiple arguments, and bun can execute TypeScript files directly without the run subcommand. Use #!/usr/bin/env bun instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/mocks/serve.ts, line 1:

<comment>The shebang `#!/usr/bin/env bun run` is non-portable. POSIX `env` doesn&#39;t reliably handle multiple arguments, and `bun` can execute TypeScript files directly without the `run` subcommand. Use `#!/usr/bin/env bun` instead.</comment>

<file context>
@@ -1,8 +1,11 @@
+#!/usr/bin/env bun run
 /**
  * Standalone HTTP server for MCP mock testing.
</file context>
Suggested change
#!/usr/bin/env bun run
#!/usr/bin/env bun

✅ Addressed in a91681a

/**
* 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
Loading