-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Workspaces foreach always exits with zero even on error #2486
Comments
I don't understand -
|
Also note that we purposefully have code setting the exit code to berry/packages/plugin-workspace-tools/sources/commands/foreach.ts Lines 323 to 328 in 909a125
|
You have misread the commandline output.
Cleaned up some output
Running test using the workspace the test fails correctly (no done)
Even running the test explicitly with foreach does NOT fail correctly
🤷🏾♂️ That is nice and well, but this issue is easily reproducible for me. The test fails when running without |
In case the problem was the way the test was boostrapped...I tried using NOTE: I did not create the linked repo, but reproducing the same/similar issue with it. |
Just following up to check if any further clarification is needed? |
yeah, having the same problem with
Running either |
We use |
Also having the same issue but only on Node v15 or above. Switching to Node v15 i get 0 (incorrect as the child command fails), also the output is cut off like it didn't finish properly. @MarsianMan you mentioned Node 15 in your issue, could you try downgrading to v14 and running it again? |
Try using yarn from master - #2255
|
Thanks @merceyz I just get
When switching to the sources version |
You need to import your plugins from sources as well https://yarnpkg.com/cli/plugin/import/from/sources |
Hi! 👋 This issue looks stale, and doesn't feature the Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃 If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the |
Can reproduce with the version in the repro but not with 3.0.0-rc.2 so closing as fixed |
Edit: Downgrading to Node 14 seems to be a temporary fix until Yarn V3 is stable/launched. |
@merceyz Somehow, I still can reproduce this bug. This is my repro: akphi/issue-repo#1. I'm using I setup a test monorepo with 2 workspaces At the root directory, if we run the following command, we got some unexpected result: yarn workspaces foreach run doSomething # no error
yarn workspaces foreach --all run doSomething # no error
yarn workspaces foreach --parallel run doSomething # no error
yarn workspaces foreach --all --parallel --topological-dev run doSomething # error Let me know if you want me to file this as a different issue. |
Describe the bug
When a build or test fails using
workspaces foreach run test
yarn should exit with a non-zero status.To Reproduce
Checkout https://github.com/marcneander/yarn-foreach-error.git
From root directory run
yarn run test && echo "done"
oryarn workspaces foreach run -pvai test && echo "done"
Expectation: in the output below, done should not output when using foreach
Note that if I run the test on the workspace directly by name, then the exit code is correct.
Screenshots
Environment if relevant (please complete the following information):
Additional context
In a non-sample project, I am trying to use yarn to run cucumber.js tests in workspaces. The tests are failing, but the build is passing.
I expect a non-zero exit code and "done" to be missing from the output.
The text was updated successfully, but these errors were encountered: