Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 60ed9d3

Browse files
Fix CI: cross-platform NODE_OPTIONS, smoke test in clean directory
- Use env block for NODE_OPTIONS (works on Windows PowerShell) - Run mcp-smoke in fresh directory without repo checkout (avoids repo package.json shadowing node_modules import) - Use bash shell for cross-platform consistency - Use npx jest directly to skip npm script shell quoting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3de7cbd commit 60ed9d3

1 file changed

Lines changed: 29 additions & 34 deletions

File tree

.github/workflows/test.yml

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
os: [ubuntu-latest, windows-latest]
1515
node-version: ['18', '20']
1616
runs-on: ${{ matrix.os }}
17+
env:
18+
NODE_OPTIONS: --max-old-space-size=2048
1719
steps:
1820
- uses: actions/checkout@v4
1921
- uses: actions/setup-node@v4
@@ -27,66 +29,59 @@ jobs:
2729
run: npm run build
2830

2931
- name: Run tests
30-
run: npm test
32+
run: npx jest --no-coverage
3133

3234
mcp-smoke:
3335
strategy:
3436
matrix:
3537
os: [ubuntu-latest, windows-latest]
3638
runs-on: ${{ matrix.os }}
3739
steps:
38-
- uses: actions/checkout@v4
3940
- uses: actions/setup-node@v4
4041
with:
4142
node-version: '20'
4243

44+
- name: Create test directory
45+
run: |
46+
mkdir smoke-test
47+
cd smoke-test
48+
npm init -y
49+
shell: bash
50+
4351
- name: Install from npm (simulates real user)
44-
run: npm install flowscript-core
52+
run: |
53+
cd smoke-test
54+
npm install flowscript-core
55+
shell: bash
4556

4657
- name: Verify import
47-
run: node -e "const { Memory } = require('flowscript-core'); console.log('Import OK, Memory:', typeof Memory);"
58+
run: |
59+
cd smoke-test
60+
node -e "const { Memory } = require('flowscript-core'); const m = new Memory(); console.log('Import OK, size:', m.size);"
61+
shell: bash
4862

4963
- name: MCP server stdio handshake
50-
shell: node {0}
5164
run: |
65+
cd smoke-test
66+
node -e "
5267
const { spawn } = require('child_process');
5368
const path = require('path');
54-
5569
const mcp = path.join('node_modules', 'flowscript-core', 'bin', 'flowscript-mcp');
56-
const proc = spawn('node', [mcp, './test-memory.json'], {
57-
stdio: ['pipe', 'pipe', 'pipe']
58-
});
59-
60-
const msg = JSON.stringify({
61-
jsonrpc: '2.0', id: 1, method: 'initialize',
62-
params: {
63-
protocolVersion: '2025-03-26',
64-
capabilities: {},
65-
clientInfo: { name: 'ci-test', version: '1.0' }
66-
}
67-
});
68-
70+
const proc = spawn(process.execPath, [mcp, './test-memory.json'], { stdio: ['pipe', 'pipe', 'pipe'] });
6971
let output = '';
70-
proc.stdout.on('data', (data) => { output += data.toString(); });
71-
72+
proc.stdout.on('data', d => output += d);
7273
setTimeout(() => {
73-
proc.stdin.write(msg + '\n');
74+
proc.stdin.write(JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2025-03-26', capabilities: {}, clientInfo: { name: 'ci', version: '1' } } }) + '\n');
7475
setTimeout(() => {
7576
const lines = output.trim().split('\n').filter(Boolean);
76-
if (lines.length === 0) {
77-
console.error('No response from MCP server');
78-
process.exit(1);
79-
}
77+
if (!lines.length) { console.error('No response'); process.exit(1); }
8078
const data = JSON.parse(lines[lines.length - 1]);
81-
if (!data.result) {
82-
console.error('Bad response:', JSON.stringify(data));
83-
process.exit(1);
84-
}
79+
if (!data.result) { console.error('Bad response:', JSON.stringify(data)); process.exit(1); }
8580
const info = data.result.serverInfo || {};
86-
console.log(`MCP server OK: ${info.name} v${info.version}`);
87-
console.log(`Platform: ${process.platform}`);
88-
console.log(`Node: ${process.version}`);
81+
console.log('MCP OK:', info.name, 'v' + info.version, '| Platform:', process.platform, '| Node:', process.version);
8982
proc.kill();
90-
console.log('PASS: MCP stdio handshake works');
83+
console.log('PASS');
9184
}, 2000);
9285
}, 1000);
86+
"
87+
shell: bash

0 commit comments

Comments
 (0)