lerna run prints "success" next to failed packages
See original GitHub issueLet’s assume I want to run all unit tests from all packages in my monorepo. So I’d call lerna run --no-bail test
. I’d specify --no-bail
because I don’t want to abort on the first error. I want to see which packages succeed and which fail. When Lerna is done, it prints a table that looks like this:
lerna success run Ran npm script ‘test’ in 5 packages in 0.3s: lerna success - package01 lerna success - package02 lerna success - package03 lerna success - package04 lerna success - package05
The problem is that Lerna prints “success” next to each package, even if the script for that package actually failed.
Expected Behavior
I’d expect “success” to be printed only if the error code of the packages’s script was zero. Otherwise, I’d expect “failure” or something similar to be printed next to the failed package.
Current Behavior
Currently, Lerna prints “success” next to every single package, even if its script failed and returned a non-zero exit code.
Steps to Reproduce (for bugs)
- Set up a monorepo with multiple packages.
- Create a script “test” in each monorepo. Make some scripts succeed (by calling “true” on Unix), make others fail (by calling “false” on Unix).
- Run
lerna run --no-bail test
lerna.json
{
"packages": ["packages/*"],
"version": "1.0.0",
"npmClient": "yarn",
"useWorkspaces": true
}
Context
I want to run the same task on all packages (no fail-fast) and see which packages succeeded and which didn’t.
Your Environment
Executable | Version |
---|---|
lerna --version |
3.13.1 |
npm --version |
5.6.0 |
yarn --version |
1.13.0 |
node --version |
v8.11.3 |
OS | Version |
---|---|
macOS High Sierra | 10.13.6 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:23
- Comments:15 (2 by maintainers)
Top GitHub Comments
I still believe that this is fundamentally broken. I would expect that
--no-bail
:stderr
), exactly like without--no-bail
success
1
(or something else?)I would really, really like to fix this, as I think
--no-bail
is basically pretty much useless otherwise, at least to me. Do you think we can / should fix the behavior of--no-bail
or rather add a new flag and maybe deprecate--no-bail
?Digging through log files of a huge mono-repo across all packages to determine which package failed is cumbersome.
Instead, something like this would be nice, when
--no-bail
is used: