test(routing): isolate reserved-char param cases from Windows#2698
Open
MaxtuneLee wants to merge 2 commits into
Open
test(routing): isolate reserved-char param cases from Windows#2698MaxtuneLee wants to merge 2 commits into
MaxtuneLee wants to merge 2 commits into
Conversation
Two Pages Router tests build temp route fixtures whose param names use characters reserved in Windows filenames: `[repo:name].tsx` (`:` opens an NTFS alternate data stream, so pagesRouter never discovers the route) and `[id*].tsx` (`*` makes writeFile throw). Both errored on `vp test run` locally on Windows. Split each test so the valid-everywhere case (`.`, `+`) runs on all platforms and the reserved-char case is gated with `it.runIf(process.platform !== "win32")`. These scenarios are unreachable on Windows in production too, so gating loses no coverage; POSIX CI still exercises them. Related to cloudflare#1792
commit: |
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
MaxtuneLee
marked this pull request as ready for review
July 24, 2026 16:51
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.
Summary
Related to #1792
Two Pages Router tests in
tests/routing.test.tsbuild temp route fixtures whose param names contain characters that are reserved in Windows filenames (:and*). On Windows these fixtures either fail to create or silently create the wrong file, so the tests error out or assert against a route that was never discovered — makingvp test rununrunnable locally on Windows even though the source under test is fine.This PR splits each affected test so the valid-on-every-platform case (
.,+) keeps running everywhere, and the POSIX-only case (:,*) is gated withit.runIf(process.platform !== "win32"). No source/runtime code changes — this is a test-portability fix.Root cause
Windows filenames may not contain
< > : " / \ | ? *. Two of these show up in Pages Router route-param fixtures:[id*].tsxwriteFilethrowsENOENT/ "The filename, directory name, or volume label syntax is incorrect"[repo:name].tsx:delimits an NTFS alternate data stream —writeFilesucceeds but the directory listing shows only[repo, and the ADSname].tsxis invisible toreaddirpagesRouternever discovers/repos/:repo:name, assertion failsChanges
tests/routing.test.ts+test (all platforms) and a*test gated to POSIX.Verification
Before (Windows):
After (Windows):
Test plan
vp test run --project unit tests/routing.test.ts(Windows) — greenvp check tests/routing.test.ts— format/lint/type clean:and*cases