fix: pass relative config path to test-server for running#538
Conversation
|
hmm, doesn't work on windows in my testing. looking more. |
|
Found the culprit! The real root cause is microsoft/playwright#9193. It still exists, but is hard to solve on Playwright's side. We can work around it by normalising the |
|
I'll summarize the behaviour we're working around here for future visitors. The Windows Filesystem is case-insensitive, but Node.js module loading is case-sensitive. That means that on Windows, You can trigger this behaviour by running Working around this is easy: Always specify file paths in the same case. #482 did this by making the paths relative. There's another weird behaviour that plays into this, though. If the What does this mean? Never ever use paths with lowercase drive letters, and don't be in a CWD that has a lowercase drive letter. Powershell realised this and made it impossible to go into a lowercase CWD, we did in #482 when we swapped absolute paths with lowercase drive letters for relative ones, and VS Code realised it when they normalize the For some reason, |
| const wsEndpoint = await startBackend(this._vscode, { | ||
| args, | ||
| cwd: this._model.config.workspaceFolder, | ||
| cwd: this._ensureUpperCaseDriveLetter(cwd), |
There was a problem hiding this comment.
- Shouldn't we do the same at lines 241 and 253 new code, inside
debugTests()? - Could line 360 new code that uses
require.resolve()have the same issue? - What about all the same places in
playwrightTestCLI.ts?
There was a problem hiding this comment.
- no, because that's a call to VS Code. VS Code already performs the disk letter uppercasing for us, see the existing comment. I'll still update it for consistency though - can't hurt to normalize on our end.
- it could have the same issue, yes. but it wouldn't manifest in the same way, because
oopReporterdoesn't import any Playwright singletons. - could have the same problems, but i'm less sure about it there because it uses
configFolderas the CWD. Let's ship changes to that in a separate PR and release, so we can roll back more easily.
|
I've done one final check on my Windows machine, and this still fixes the issue. I'll merge and release this PR, and extend the patch to |
Closes microsoft/playwright#32959. Similar to the fix we shipped for debugging in #482 and #484.