-
Notifications
You must be signed in to change notification settings - Fork 0
test: use bun for mcp server mock #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
bun install all deps automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the MCP mock server from using pnpm to bun as the runtime and package manager. The change simplifies the development environment setup by removing the shellHook dependency installation logic and leveraging bun's capabilities.
Key changes:
- Added shebang and direct execution usage example to
tests/mocks/serve.ts - Removed pnpm installation logic from the Nix flake shellHook (dependency installation now handled at runtime in conftest.py)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/mocks/serve.ts | Added shebang for direct script execution and updated documentation with new usage examples |
| flake.nix | Removed automatic pnpm dependency installation from shellHook, relying on runtime installation via conftest.py instead |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/mocks/serve.ts
Outdated
| @@ -1,8 +1,11 @@ | |||
| #!/usr/bin/env bun run | |||
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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.
| #!/usr/bin/env bun run | |
| #!/usr/bin/env bun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="tests/mocks/serve.ts">
<violation number="1" location="tests/mocks/serve.ts:1">
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.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
tests/mocks/serve.ts
Outdated
| @@ -1,8 +1,11 @@ | |||
| #!/usr/bin/env bun run | |||
There was a problem hiding this comment.
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'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>
| #!/usr/bin/env bun run | |
| #!/usr/bin/env bun |
✅ Addressed in a91681a
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
Summary by cubic
Use Bun for the MCP mock test server to simplify setup and execution. The server now uses a cross-platform Bun shebang, tests launch it directly, and install steps are removed.
Written for commit 7ad3f54. Summary will update on new commits.