Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

test(analyze): resolve tsx across workspace install layouts

Rudy Celekli1a9c5b678db4
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();