Skip to content
Merged
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
41 changes: 41 additions & 0 deletions .github/workflows/cli_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CLI Tests

on:
push:
paths:
- "cli/**"
pull_request:
paths:
- "cli/**"

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cli
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm

- name: Install dependencies
run: |
cd ..
npm ci --ignore-scripts

- name: Build CLI
run: npm run build

- name: Explicitly pre-install test dependencies
run: npx -y @modelcontextprotocol/server-everything --help || true

- name: Run tests
run: npm test
env:
NPM_CONFIG_YES: true
CI: true
2 changes: 1 addition & 1 deletion cli/scripts/cli-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const colors = {

import fs from "fs";
import path from "path";
import { execSync, spawn } from "child_process";
import { spawn } from "child_process";
import os from "os";
import { fileURLToPath } from "url";

Expand Down
2 changes: 1 addition & 1 deletion cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async function main(): Promise<void> {
const args = parseArgs();

if (args.cli) {
runCli(args);
await runCli(args);
} else {
await runWebClient(args);
}
Expand Down
2 changes: 2 additions & 0 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ async function main(): Promise<void> {
try {
const args = parseArgs();
await callMethod(args);
// Explicitly exit to ensure process terminates in CI
process.exit(0);
} catch (error) {
handleError(error);
}
Expand Down