Skip to content
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] Lerna swallows exit code when NODE_ENV is test #406

Closed
taion opened this issue Nov 15, 2016 · 7 comments · Fixed by #440
Closed

[Bug] Lerna swallows exit code when NODE_ENV is test #406

taion opened this issue Nov 15, 2016 · 7 comments · Fixed by #440

Comments

@taion
Copy link

taion commented Nov 15, 2016

Due to this code: https://github.com/lerna/lerna/blob/v2.0.0-beta.30/src/Command.js#L156-L158

Lerna commands won't pass through their exit codes when NODE_ENV is test.

CircleCI automatically sets NODE_ENV to test for builds that use Node, so if you do something like lerna run test, your build won't fail when your tests fail.

@jamiebuilds
Copy link
Contributor

We should change that to NODE_ENV=lerna-test since that's for our own test suite

@taion
Copy link
Author

taion commented Nov 16, 2016

I'm not sure they're mutually exclusive. Presumably you still want to hide progress bars – unless you want to modify the other checks for NODE_ENV as well.

@jamiebuilds
Copy link
Contributor

Ah good point, we can just move it to a method and mock it in the tests

@jamiebuilds jamiebuilds changed the title Lerna swallows exit code when NODE_ENV is test [Bug] Lerna swallows exit code when NODE_ENV is test Nov 16, 2016
@timdp
Copy link

timdp commented Nov 24, 2016

After looking at the code, I wrongfully assumed that NODE_ENV=test would just hide the progress bars, and then I ended up not noticing broken tests. So I'd like to second what @taion said.

camwest pushed a commit to Autodesk/orion-ui that referenced this issue Dec 8, 2016
* add lint dependencies to packages, add lint to storybook
* Add node_modules cache directories
* Add root level node_modules to cache
* Set NODE_ENV to ci to fix lerna suppressing error messages (see lerna/lerna#406)
* Update node to the latest LTS release
@ryb73
Copy link
Contributor

ryb73 commented Dec 13, 2016

Looks like NODE_ENV=test will also cause Lerna to suppress logging to stdout and ignore Lerna version mismatches (the former I discovered the hard way, the latter I found by CTRL+F-ing for "NODE_ENV").

In response to @taion's comment:

I'm not sure they're mutually exclusive. Presumably you still want to hide progress bars – unless you want to modify the other checks for NODE_ENV as well.

If the checks you're referring to are the ones I mentioned above, it seems reasonable (and preferable) to modify them – would you agree? If so I'd be happy to put in a PR implementing @thejameskyle's first suggestion of changing it to lerna-test.

@gigabo
Copy link
Contributor

gigabo commented Dec 13, 2016

@ryb73 Yeah, that sounds worthwhile. Thanks!

@lock
Copy link

lock bot commented Dec 28, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants