test(filesystem): add regression tests for Docker Linux path handling#3805
Draft
majiayu000 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Draft
test(filesystem): add regression tests for Docker Linux path handling#3805majiayu000 wants to merge 1 commit intomodelcontextprotocol:mainfrom
majiayu000 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Add tests for issue modelcontextprotocol#3628 where single-letter root directories (/h/, /u/, /d/) on Linux Docker containers were incorrectly converted to Windows drive letter paths (H:\, U:\, D:\). The code fix exists on main via platform detection in normalizePath and convertToWindowsPath. These tests mock process.platform to 'linux' and verify paths are preserved as-is. Signed-off-by: majiayu000 <1835304752@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3628
Description
Adds regression tests for the Docker/Linux path normalization bug where paths like
/h/username/MCP_Development/datagot wrongly converted toH:\username\MCP_Development\data. The code fix already landed on main (commit c9b0135 added platform detection tonormalizePathandconvertToWindowsPath), but there were no tests covering the exact scenario from the issue.New tests mock
process.platformto'linux'(simulating Docker Alpine) and verify that single-letter root directories (/h/,/u/,/d/) aren't mistaken for Windows drive letters. Uses the same mocking pattern already in the WSL test block.Note: Docker image 1.0.2 still has the bug. It needs rebuilding from current main to pick up the fix.
Server Details
path-utils.test.ts)Motivation and Context
Issue #3628 reports that the filesystem server running in Docker Alpine Linux converts valid Linux paths to Windows-style paths. The fix exists but had no dedicated test coverage for the Docker scenario.
How Has This Been Tested?
cd src/filesystem && npm test— all 149 tests pass (7 test files), including the new regression tests.Breaking Changes
None. Test-only change.
Types of changes
Checklist