Improve test coverage for Python adapter utils#10
Conversation
Adds comprehensive test suite for packages/adapter-python/src/utils/python-utils.ts to improve test coverage. Coverage improvements: - Statements: 72.95% → 76.5% - Branches: 83.48% → 87.17% ✓ - Functions: 80% → 80% ✓ New test file: - packages/adapter-python/tests/unit/python-utils.comprehensive.test.ts Test coverage includes: - CommandNotFoundError class - setDefaultCommandFinder function - Windows platform-specific behavior (Path vs PATH, Store aliases, .exe handling) - Environment variable handling (PYTHON_PATH, PYTHON_EXECUTABLE, pythonLocation, PythonLocation) - Multiple Python installations with debugpy preference - Error scenarios and edge cases - getPythonVersion function (all code paths) - Verbose discovery logging - Windows Store alias detection - pythonLocation candidate checking - Spawn error handling Total tests: 44 (32 new + 12 existing from python-utils.discovery.test.ts) Dependencies added: - @vitest/coverage-v8 for coverage reporting
Build Failure - Branch Needs UpdateThe CI builds are failing due to a missing dependency that was added to main after this branch was created. Specifically, commit |
Build Failure - Branch Needs UpdateThe CI builds are failing due to a missing dependency that was added to main after this branch was created. Specifically, commit 05c6152 introduced AdapterLaunchBarrier which is now required by the build. Error: To FixPlease update your branch with the latest changes from main:
If you do not have upstream configured: Once merged and pushed, the CI will automatically re-run and should pass (as it did for PR #9 after the same fix). |
Build Failure - Branch Needs UpdateThe CI builds are failing due to a missing dependency that was added to main after this branch was created. Specifically, commit 05c6152 introduced AdapterLaunchBarrier which is now required by the build. Error: To FixPlease update your branch with the latest changes from main: git checkout claude/improve-python-utils-tests-011CUzgqeMN4zYuHuvCuoJGT
git fetch upstream
git merge upstream/main
git push origin claude/improve-python-utils-tests-011CUzgqeMN4zYuHuvCuoJGTIf you do not have upstream configured: git remote add upstream https://github.com/debugmcp/mcp-debugger.gitOnce merged and pushed, the CI will automatically re-run and should pass (as it did for PR #9 after the same fix). |
…-utils-tests-011CUzgqeMN4zYuHuvCuoJGT
…-utils-tests-011CUzgqeMN4zYuHuvCuoJGT
|
Closing this PR as the test improvements have been cherry-picked directly to main (commit 4330698). The build configuration issues that were preventing CI from passing have been resolved separately in main. |
Adds comprehensive test suite for packages/adapter-python/src/utils/python-utils.ts to improve test coverage.
Coverage improvements:
New test file:
Test coverage includes:
Total tests: 44 (32 new + 12 existing from python-utils.discovery.test.ts)
Dependencies added:
📋 Description
Please include a summary of the changes and which issue is fixed. Include relevant motivation and context.
Fixes # (issue number)
🔄 Type of Change
Please delete options that are not relevant.
✅ Checklist
🧪 Testing
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Test Configuration:
📸 Screenshots (if applicable)
If your changes include UI updates or visual debugging improvements, please add screenshots.
🔗 Related Issues
Link any related issues here:
📝 Additional Notes
Any additional information that reviewers should know.
Reviewer: @debugmcp