fix(watchman): Fix watchman checks on Windows#5553
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5553 +/- ##
=========================================
- Coverage 61.71% 61.7% -0.01%
=========================================
Files 213 213
Lines 7149 7150 +1
Branches 3 3
=========================================
Hits 4412 4412
- Misses 2736 2737 +1
Partials 1 1
Continue to review full report at Codecov.
|
Member
|
Awesome, thank you so much for fixing this! |
jessecarfb
pushed a commit
to jessecarfb/jest
that referenced
this pull request
Feb 14, 2018
BYK
added a commit
that referenced
this pull request
Feb 19, 2018
…sues **Summary** Watchman crawler was ignoring the `relative_path` field in the response of a `watch-project` call, requiring it to match watch roots with the actual project roots afterwards. Not only this was inefficient, it was also faulty due to the naive `.startsWith()` check in `isDescendant()`. This was causing issues both with Windows file paths (#5553) and after that with case-insensitive file systems where the names from Watchman did not match the casing of the passed roots. This patch replaces all that logic by taking the `relative_path` field into account and does some consolidation along with using `async`/`await` instead of promises. **Test plan** Run the updated test suite on all platforms and make sure it passes. I've also verified this on some internal Windows repos by manually patching the built module and making sure there are no warnings regarding duplicated haste names due to incorrect crawling of project root siblings.
BYK
added a commit
that referenced
this pull request
Feb 19, 2018
…5615) **Summary** Watchman crawler was ignoring the `relative_path` field in the response of a `watch-project` call, requiring it to match watch roots with the actual project roots afterward. Not only this was inefficient, it was also faulty due to the naive `.startsWith()` check in `isDescendant()`. This was causing issues both with Windows file paths (#5553) and after that with case-insensitive file systems where the names from Watchman did not match the casing of the passed roots. This patch replaces all that logic by taking the `relative_path` field into account and does some consolidation along with using `async`/`await` instead of promises. **Test plan** Run the updated test suite on all platforms and make sure it passes. I've also verified this on some internal Windows repos by manually patching the built module and making sure there are no warnings regarding duplicated haste names due to incorrect crawling of project root siblings.
|
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
This patch fixes a long-standing issue with the watchman crawler. Watchman always returns POSIX-style paths with forward-slashes in it and Jest uses the "raw"
rootsarray which has Windows-style paths in it. This makes the fast but naiveisDescendantcheck that simply does a.startsWithcheck and causes failures in listening folders or checks.Test plan
Run the test suite on Windows. If you keep the updated tests and undo the changes in the
watchmancrawler, the tests fail on Windows. With the fix in place, tests pass.