From 1a9c5b678db4aa32f43ab6db60e35cffbceecdc5 Mon Sep 17 00:00:00 2001 From: Rudy Celekli Date: Mon, 28 Sep 2026 02:19:00 -0400 Subject: [PATCH] test(analyze): resolve tsx across workspace install layouts --- .../cli/__tests__/ruvector/graph-analyzer.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v3/@claude-flow/cli/__tests__/ruvector/graph-analyzer.test.ts b/v3/@claude-flow/cli/__tests__/ruvector/graph-analyzer.test.ts index 63d4995d35..bb71b09ed2 100644 --- a/v3/@claude-flow/cli/__tests__/ruvector/graph-analyzer.test.ts +++ b/v3/@claude-flow/cli/__tests__/ruvector/graph-analyzer.test.ts @@ -26,6 +26,7 @@ import { } from '../../src/ruvector/graph-analyzer.js'; import { mkdir, writeFile, rm } from 'fs/promises'; import { spawnSync } from 'child_process'; +import { createRequire } from 'module'; import { join } from 'path'; import { tmpdir } from 'os'; import { fileURLToPath } from 'url'; @@ -105,7 +106,9 @@ export { main, helper }; // Run the parser in a child: a regex regression can block the event loop, // so a normal Vitest timeout cannot interrupt it. - const tsx = fileURLToPath(new URL('../../node_modules/tsx/dist/cli.mjs', import.meta.url)); + // CI installs dependencies at the repository root, while package-local + // installs place tsx under this package. Resolve either layout. + const tsx = createRequire(import.meta.url).resolve('tsx/cli'); const source = fileURLToPath(new URL('../../src/ruvector/graph-analyzer.ts', import.meta.url)); const probe = `import(${JSON.stringify(source)}).then(async ({ buildDependencyGraph }) => { const graph = await buildDependencyGraph(${JSON.stringify(testDir)}, { skipCache: true }); @@ -115,7 +118,7 @@ export { main, helper }; const result = spawnSync(process.execPath, [tsx, '--eval', probe], { cwd: testDir, encoding: 'utf8', - timeout: 2000, + timeout: 5000, }); expect(result.error).toBeUndefined();