From fa86171d096ff5df06b88871a6ecb9b69c41a1fb Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Wed, 10 Jun 2026 22:41:29 +0200 Subject: [PATCH] chore(mcp): align ci script naming --- Justfile | 2 +- docs/adrs/adr-0016-js-tool-verification.md | 10 +++++----- tools/mcp-bridge/package.json | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Justfile b/Justfile index 4f78f97..063eae8 100644 --- a/Justfile +++ b/Justfile @@ -134,7 +134,7 @@ npm-test-integration: # Run Node-based tool CI. npm-ci: - npm run ci --prefix tools/mcp-bridge + npm run test:ci --prefix tools/mcp-bridge # Build generated artifacts. build: npm-build diff --git a/docs/adrs/adr-0016-js-tool-verification.md b/docs/adrs/adr-0016-js-tool-verification.md index 137599a..e60c42b 100644 --- a/docs/adrs/adr-0016-js-tool-verification.md +++ b/docs/adrs/adr-0016-js-tool-verification.md @@ -20,8 +20,8 @@ Keep the Node package scripts simple and one-purpose: - `npm run build` emits TypeScript into `dist/` and acts as the type-check gate. - `npm run test` runs the Node unit tests directly from TypeScript with `tsx --test test/*.test.ts`. No prior build is required. -- `npm run check` runs ESLint. TypeScript compilation is covered by `npm run build` and `npm run ci` to avoid duplicate compiler runs in repository CI. -- `npm run ci` runs `npm run check && npm run build && npm run test`, so type errors and lint failures both surface even though `test` itself no longer compiles. +- `npm run check` runs ESLint. TypeScript compilation is covered by `npm run build` and `npm run test:ci` to avoid duplicate compiler runs in repository CI. +- `npm run test:ci` runs `npm run check && npm run build && npm run test`, so type errors and lint failures both surface even though `test` itself no longer compiles. - `npm run test-integration` runs the bridge-to-CraftOS integration suite with `tsx --test --test-concurrency=1 test-integration/*.test.ts`. Each case boots the bridge in-process on fixed loopback ports (`127.0.0.1:2000` for MCP HTTP, `127.0.0.1:2001` for the CraftOS link), spawns a CraftOS-PC headless computer that connects back, exercises `tools/call probe-computers`, and tears everything down. `--test-concurrency=1` keeps the fixed ports collision-free. Expose matching repository recipes for the Node lifecycle: @@ -29,14 +29,14 @@ Expose matching repository recipes for the Node lifecycle: - `just build` delegates to `npm run build` for the bridge. - `just test` depends on `just build`, runs `npm run test`, then runs the existing CraftOS-PC test suite. - `just check` includes `npm run check` alongside Lua and Markdown checks. -- `just ci` uses `npm run ci`, then runs CraftOS-PC tests and the broader integration/harness target. +- `just ci` uses `npm run test:ci`, then runs CraftOS-PC tests and the broader integration/harness target. - `just test-integration` runs the placeholder Node integration target and the Lua timeout harness checks. ## Consequences - `npm run test` no longer needs `dist/`. Both unit and integration tests load TypeScript directly through `tsx`, so test iteration is faster and `dist/` is only required for `npm start`. -- TypeScript errors are no longer caught by `npm run test`; they are caught by `npm run build`, which stays wired into `npm run ci`, `just build`, `just test`, and `just ci`. -- `just ci` avoids duplicating Node unit tests by calling `npm run ci` directly and then invoking only the CraftOS-side test body. +- TypeScript errors are no longer caught by `npm run test`; they are caught by `npm run build`, which stays wired into `npm run test:ci`, `just build`, `just test`, and `just ci`. +- `just ci` avoids duplicating Node unit tests by calling `npm run test:ci` directly and then invoking only the CraftOS-side test body. - ESLint failures are part of `just check`, so they are covered by the same pre-commit and pre-push hooks as Lua and Markdown checks. - Integration tests live in `tools/mcp-bridge/test-integration/`, with Lua client fixtures under `test-integration/lua/`. Slow end-to-end behavior stays out of the fast unit-test path. diff --git a/tools/mcp-bridge/package.json b/tools/mcp-bridge/package.json index 0a8c581..2890dc2 100644 --- a/tools/mcp-bridge/package.json +++ b/tools/mcp-bridge/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "tsc --noEmit false", "check": "eslint .", - "ci": "npm run check && npm run build && npm run test", + "test:all": "npm run check && npm run build && npm run test", + "test:ci": "npm run test:all && npm run test-integration", "dev": "tsx src/index.ts", "start": "node dist/src/index.js", "test": "tsx --test test/*.test.ts",