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

Change testing NODE_ENV to "lerna-test" (Fixes #406) #440

Merged
merged 2 commits into from
Dec 15, 2016

Conversation

ryb73
Copy link
Contributor

@ryb73 ryb73 commented Dec 14, 2016

fixes #406

Previously, when running Lerna with NODE_ENV set to "test", it would output nothing to stdout and always exit with a code of 0. Now the output and exit code will not be suppressed.

Copy link
Contributor

@gigabo gigabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ryb73 this LGTM.

@taion does this work for you?

@gigabo gigabo added the bug label Dec 14, 2016
@@ -18,7 +18,7 @@ class ProgressBarController {
}

// Don't do any of this while testing
if (process.env.NODE_ENV === "test") {
if (process.env.NODE_ENV === "lerna-test") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the progress bar does look a bit wonky in CI logs. wonder if there's a better flag here... maybe env.CONTINUOUS_INTEGRATION or something

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, wonky whenever we're not running interactively.

Maybe a better check here would be whether we're connected to a tty?

if (process.stdout.isTTY) {
    ...
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's irrelevant to this PR anyway, just a quirk i noticed after i unset NODE_ENV on circle. probably best to add a FIXME and sort this out later, since it's not that important

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #447. Thanks for looking at this @taion.

@gigabo gigabo merged commit 2db4adc into lerna:master Dec 15, 2016
@ryb73 ryb73 deleted the change-test-env branch December 15, 2016 19:33
@petercasinelli
Copy link

Hey, thanks for catching this! Is there any way you can release this sooner rather than later? It's a blocker for people relying on tests to fail a build. Right now, a build can pass even if the tests fail because the exit codes are not propagated. I'm experiencing this right now with CircleCI.

I considered pulling in the master branch in, but in order to use it, you'll need to run npm i and install Lerna globally from the cloned repo. This is unrealistic for continuous integration because you'd need to clone for every build.

@taion
Copy link

taion commented Dec 19, 2016

This ought not be a blocker with Circle. Just do

dependencies:
  override:
    # Circle sets NODE_ENV to test by default, which messes with both Lerna and
    # babel-plugin-dev-expression.
    - unset NODE_ENV
    - npm i

@lock
Copy link

lock bot commented Dec 27, 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 27, 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 this pull request may close these issues.

[Bug] Lerna swallows exit code when NODE_ENV is test
4 participants