-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: allow more tests to run on windows #10351
Conversation
Yay! Better coverage on Windows is wonderful |
For sure, although |
it('does not report --notify flag', () => { | ||
if (process.platform === 'win32') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only test aside from the yarn pnp one that is now being skipped on Windows 🎉
Open to ideas on if anything can be done to eliminate it - I suspect it represents an actual "bug" (/ maybe just something that can't be supported?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, thank you so much!
@@ -30,7 +27,9 @@ test('CLI accepts exact file names if matchers matched', () => { | |||
|
|||
expect(result.exitCode).toBe(0); | |||
|
|||
const {rest, summary} = extractSummary(result.stderr); | |||
const {rest, summary} = extractSummary( | |||
result.stderr.replace('\\\\foo\\\\bar', '\\/foo\\/bar'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we normalize the output of jest instead of normalizing in the test itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, yes but I don't know how much work that'll involve.
However, I don't know if thats a good idea from UX POV, as jest
is implicitly normalizing the input - we pass in ./foo/bar.spec.js
, which is a Linux style file path (it's actually probably node doing the normalizing, but the result is the same).
By outputting the actual OS-specific file path that was used, users can see that it doesn't matter if they pass in Linux file paths; where as if we normalised them in the output here, personally I'd look at that and think "oh maybe Jest isn't finding my test file because it's using the Linux file path" (especially since copying & pasting the file path into Windows would cause an error, as iirc Powershell, CMD, and Explorer all expect forward slashes).
it('does not report --notify flag', () => { | ||
if (process.platform === 'win32') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same as the skip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, as the skip causes all tests in the file to be skipped, but this is the only one that actually fails.
@@ -29,14 +29,6 @@ export function skipSuiteOnJestCircus(): void { | |||
} | |||
} | |||
|
|||
export function skipSuiteOnWindows(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping this until all skips are resolved seems better to me - easier to find usage 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was in part for the excitement of it - the two tests that are remaining don't seem like they're going to go away anytime soon (the yarn pnp one at least), and I felt that removing this helper made it harder to justify skipping future tests in Windows.
Happy to add it back 🙂
I remembered the real reason: this helper causes all tests in the file to be skipped, regardless of where it's used.
Of the two tests remaining that would use it, only the yarn pnp one has one test in its file, so using it skips a whole host of other tests that pass on Windows.
Thus, if you take that out of the picture, you're just left with one test that would be using it, and that is unlikely to go away soon from what I understand; I felt that inling it would make it harder to justify skipping tests on Windows in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aight, consider me convinced! 🙂
Windows is falling again 🙂 |
The failures are in Looking over the code, theres a few paths I've missed, and at the failures, some of them don't surprise me, i.e
I originally kept the root slash in, thinking it was part of how haste-map worked, but it seems I was just wrong. |
@G-Rath mark as ready wehen it is? |
@SimenB will do - I'm afk right now but when I'm back I'll squash and mark as ready 🎉🎉 |
We squash merge, so no worries 🙂 |
Thanks! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Closes #3121 (mostly) - the only two outstanding are the yarn pnp test & an open handles test.
Test plan
See if Windows runs in CI passes after adjusting the relevant tests.