UNPKG

@debugmcp/mcp-debugger

Version:

Run-time step-through debugging for LLM agents.

125 lines (102 loc) 4.37 kB
# Task 4.3b: Test Reorganization - File Movement Phase Summary ## Overview Successfully completed the file movement phase of test reorganization to align with the new adapter pattern architecture. ## Completion Details - **Started**: 2025-01-07 12:52 - **Completed**: 2025-01-07 13:23 - **Total Files Moved**: 33 test files - **Python Tests Tagged**: 7 files with @requires-python ## Files Moved by Category ### Core Unit Tests (21 files) 1. **ProxyManager Tests** (3 files) → `tests/core/unit/proxy/` - proxy-manager-lifecycle.test.ts - proxy-manager-communication.test.ts - proxy-manager-error.test.ts 2. **SessionManager Tests** (12 files) → `tests/core/unit/session/` - session-manager-dap.test.ts - session-manager-paths.test.ts - session-manager-state.test.ts - session-manager-workflow.test.ts - session-manager-multi-session.test.ts - session-manager-dry-run.test.ts - session-manager-edge-cases.test.ts - session-manager-error-recovery.test.ts - session-manager-integration.test.ts - session-manager-memory-leak.test.ts - session-store.test.ts - session-manager-test-utils.ts (helper file) 3. **Server Tests** (2 files) → `tests/core/unit/server/` - server.test.ts - dynamic-tool-documentation.test.ts 4. **Factory Tests** (1 file) → `tests/core/unit/factories/` - proxy-manager-factory.test.ts 5. **Utils Tests** (2 files) → `tests/core/unit/utils/` - logger.test.ts - path-translator.test.ts 6. **Adapter Tests** (2 files) → `tests/core/unit/adapters/` - adapter-registry.test.ts - mock-adapter.test.ts ### Core Integration Tests (3 files) → `tests/core/integration/` - container-paths.test.ts - path-resolution.test.ts - proxy-startup.test.ts ### Python Tests (9 files) 1. **Python Unit Tests** (2 files) → `tests/adapters/python/unit/` - python-utils.test.ts - python-adapter.test.ts 2. **Python Integration Tests** (5 files) → `tests/adapters/python/integration/` - python-discovery.test.ts - python-discovery.failure.test.ts - python-discovery.success.test.ts - python_debug_workflow.test.ts - python-real-discovery.test.ts ## Import Pattern Updates ### Standard Import Path Changes ```typescript // Old pattern (from tests/unit/*) import { helper } from '../test-utils/helpers/helper.js'; import { mock } from '../mocks/mock.js'; // New patterns // From tests/core/unit/* (one level deeper) import { helper } from '../../../test-utils/helpers/helper.js'; import { mock } from '../../../test-utils/mocks/mock.js'; // From tests/core/integration/* import { helper } from '../../test-utils/helpers/helper.js'; import { mock } from '../../test-utils/mocks/mock.js'; // From tests/adapters/python/* import { helper } from '../../../test-utils/helpers/helper.js'; import { mock } from '../../../test-utils/mocks/mock.js'; ``` ## Scripts Created 1. `fix-proxy-imports.cjs` - Fixed ProxyManager test imports 2. `move-session-tests.cmd` - Batch move SessionManager tests 3. `fix-session-imports.cjs` - Fixed SessionManager test imports 4. `fix-server-imports.cjs` - Fixed Server test imports 5. `fix-utils-imports.cjs` - Fixed Utils test imports 6. `fix-adapter-imports.cjs` - Fixed Adapter test imports 7. `fix-python-adapter-imports.cjs` - Fixed Python adapter test imports 8. `fix-integration-imports.cjs` - Fixed all integration test imports ## Python Test Tagging All Python-specific tests now include the `@requires-python` tag: ```typescript describe('TestName', { tag: '@requires-python' }, () => { // test implementation }); ``` ## Next Steps - Run full test suite to verify all tests pass - Update vitest.config.ts if needed - Update package.json test scripts - Clean up empty directories - Update tests/README.md with new structure ## Benefits Achieved 1. **Clear separation** between core tests (Mock adapter) and Python-specific tests 2. **Better organization** with unit/integration split 3. **Easier test filtering** with @requires-python tags 4. **Consistent import patterns** across all test files 5. **Preserved git history** using git mv commands ## Technical Notes - Used git mv for all file movements to preserve history - All imports automatically adjusted for new directory depth - No test logic was modified, only file locations and imports - ESLint warnings on .cjs scripts are expected (CommonJS requirement)