-
-
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
[Bug]: Watch fails if SL (Steam Locomotive) is installed #14046
Comments
Good catch. I was looking at Sapling documentation, might be there is one more related issue on PowerShell:
Reference: https://sapling-scm.com/docs/introduction/installation#windows Seems to be sensible to check that |
I think that would work. If you run |
On my system, having Environment:
|
Copying from my own issue (which is now closed): Having steam locomotive installed (on macOS via brew) caused watch runs to fail with a weird error:
after digging around it turned out that the formatting is bad (and probably should also be fixed) but that opaque error is actually the following:
|
I would like to suggest that fixing this issue should include displaying a more descriptive error in this case than the one it does: ● Test suite failed to run
thrown: [Error] |
/cc @vegerot |
We might need to revert the |
We can take a similar approach to ripgrep and walk up the directory tree until we find a I can come up with ridiculous edge cases. What if someone install both 🚂 and Sapling, but renames Sapling from I think the best solution would be to detect 🚂 and then skip running sapling. Hacky proposal: check the size of |
@SimenB I called in the pros |
The conclusion in facebook/sapling#597 is similar, but what should that error say? "Jest detected that Many users will not know what Sapling is (I did not know few weeks ago). Also, why Jest needs This brings an idea of some opt-out mechanism (leave my Just wanted to explain what was the thinking path. Not a fan of adding more and more options. Obviously the problem should be solved on Jest side. Its main task is to run tests. Having an opt-in PS By the way, if the default is set to |
I'm liking the suggestion here to ship a I think it would also avoid the issue of having to add some sort of Of course, this all assumes there isn't already some other tool that provides a |
I think that it should pass through the existing error, something like This case doesn't need a special error, because the underlying issue should be fixed by one of the several proposals (a Just having that error show up would unblock people, because you can see "something is up with I'm asking for this also because this is not the only Jest error I've seen that failed with |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This is certainly still an issue |
@rmartine-ias I agree with you. If I would have seen that error I would have been able to find this bug report much faster. I only found it because I also started digging in node_modules for answers. Showing the error would help more people finding a faster solution. I uninstalled |
This is the obviously correct solution. The problem is that the error message is so bad people don't realize they need to do this. I think we can check the size of the @strager also had another idea to improve the error reporting, but needs to elaborate it more |
Unlinking/uninstalling Homebrew has > 20k people who have installed |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
👍 |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Not stale, would be great if this was a configuration option instead |
@rmartine-ias I fully agree that uninstalling is a good temporary workaround. What do you think a more permanent solution to the A config option? or something better possibly? |
I am not familiar with the project's internals, or what tradeoffs the maintainers make, so I don't think I am the person to ask. I am probably missing some context or misreading some code. That said, I would:
I think this would get:
It would make it so that adding or removing SCM roots while running watch does not work as prior, though. I am sure somebody is doing this. The "only find roots once" thing can be dropped; that is a performance enhancement of questionable value. |
gosh I feel super frustrated when the worlds collide and you can't understand why that's happening. the error message desperately need fixing. luckily, we do know the culprit in this example, but next time it could be some other piece of software causing interference and as-is there's not a single clue to tell the reason and debug. |
In that case: Why not use |
A framework whose purpose is to support quality approaches, with an error message like this ("thrown: [Error]"), with no fix in the 10 months since the bug was reported - it is shameful. I just lost hours to this. By merely providing a clearer error message this would be greatly remediated, at least as a stopgap measure until a more sophisticated improvement can be made. |
I just ran into the same issue; this needs to be fixed. I just spent a bunch of time debugging core jest code to properly have this error be thrown. |
For a hacky solution to get yourself unblocked (and you don't need sapling to be called):
|
@rmartine-ias #14046 (comment)
I created a workaround using that approach, since jest checks for sapling with #!/usr/bin/env zsh
if [[ $1 == 'root' ]]; then
exit 1
fi
exec /opt/homebrew/bin/sl "$@" This could be patched into the |
Wasted a few hours on this. |
Why not just uninstall SL? :D |
When running jest in watch mode, with `sl` installed (https://github.com/mtoyoda/sl), it errors out with the following message: ``` ● Test suite failed to run thrown: [Error] ``` This is bad because the error is extremely hard to debug. This change makes it error as follows: ``` ● Test suite failed to run Command failed with ENAMETOOLONG: sl status -amnu /Users/rmartine/dev/ias-backstage/packages/backend spawn ENAMETOOLONG ``` This, at least, points people in the right direction. See also: jestjs#14046
it's critical to my workflow :P |
Jest detects whether a repository is a sapling repo by calling the `sl` binary, and getting the output. If `sl` (steam locomotive) is installed, the output of `sl root` 1) takes forever to get and 2) is not the root, but a moving image of a steam locomotive. This change monitors the stdout stream, and aborts the `sl` call if the first character is an escape character, which indicates that the terminal is being cleared to make way for a train to come through. See also: jestjs#14046
* Fix error message for `sl` (steam locomotive) When running jest in watch mode, with `sl` installed (https://github.com/mtoyoda/sl), it errors out with the following message: ``` ● Test suite failed to run thrown: [Error] ``` This is bad because the error is extremely hard to debug. This change makes it error as follows: ``` ● Test suite failed to run Command failed with ENAMETOOLONG: sl status -amnu /Users/rmartine/dev/ias-backstage/packages/backend spawn ENAMETOOLONG ``` This, at least, points people in the right direction. See also: #14046
Jest detects whether a repository is a sapling repo by calling the `sl` binary, and getting the output. If `sl` (steam locomotive) is installed, the output of `sl root` 1) takes forever to get and 2) is not the root, but a moving image of a steam locomotive. This change monitors the stdout stream, and aborts the `sl` call if the first character is an escape character, which indicates that the terminal is being cleared to make way for a train to come through. See also: #14046
@rmartine-ias do you think we can call this fixed after #15053? Released in https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.4 if people wanna test it 🙂 |
@SimenB yes, I think this should do it :) |
Yay 😁! Thanks so much @rmartine-ias for fixing my shitty code |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
29.5.0
Steps to reproduce
brew install sl
npm install
npx jest --watch
Expected behavior
npx jest --watch
runs and prints the following message:Actual behavior
npx jest --watch
fails with the following message:Additional context
#13941 introduced support for Sapling which provides a command named
sl
. This conflicts with thesl
command provided by SL (Steam Locomotive). When you have SL installed on your machine rather than Sapling,jest-changed-files
fails to run properly.Environment
The text was updated successfully, but these errors were encountered: