Skip to content

Commit dd58316

Browse files
committed
fix: resolve CI module linking errors by isolating test mocks from production dependencies
## Root Cause Analysis CI was failing with 78 "module is already linked" errors due to import chain: test files → utils/command.js → utils/logger.js → @sentry/node → native modules This chain caused Vitest's vmThreads pool to load native modules multiple times across VM contexts, triggering Linux glibc's module linking restrictions. ## Solution: Surgical Mock Function Migration - Created isolated test-utils/mock-executors.ts with exact copies of mock functions - Removed all mock functions from utils/command.ts (production dependency chain) - Updated 54+ test files to import mocks from test-utils/mock-executors.js - Extracted CommandExecutor and FileSystemExecutor interfaces to separate files - Maintained zero behavioral changes to preserve all 1046 passing tests ## Key Changes - NEW: src/test-utils/mock-executors.ts - Isolated test mocks (no production deps) - NEW: src/utils/CommandExecutor.ts - Command executor interface - NEW: src/utils/FileSystemExecutor.ts - File system executor interface - MODIFIED: src/utils/command.ts - Removed mock functions, kept production executors - MODIFIED: 54+ test files - Updated imports to use isolated test-utils ## Import Chain Resolution BEFORE: test files → utils/command.js → utils/logger.js → @sentry/node (BROKEN) AFTER: test files → test-utils/mock-executors.js (ISOLATED ✅) ## Verification - All 1046 tests pass locally with surgical migration - Linting and TypeScript compilation clean - Production command execution unchanged - Test mock behavior preserved exactly Resolves Ubuntu CI "module is already linked" errors while maintaining test reliability and production functionality.
1 parent 29fb327 commit dd58316

File tree

77 files changed

+417
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+417
-751
lines changed

TOOL_NAMING_VERIFICATION_2025-08-14_22-13.md

Lines changed: 0 additions & 208 deletions
This file was deleted.

TOOL_NAMING_VERIFICATION_2025-08-14_22-13.md.bak

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)