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

--no-bail doesn't return exit code 1 when failed #1653

Closed
oreporan opened this issue Sep 5, 2018 · 2 comments · Fixed by JetBrains/ring-ui#397
Closed

--no-bail doesn't return exit code 1 when failed #1653

oreporan opened this issue Sep 5, 2018 · 2 comments · Fixed by JetBrains/ring-ui#397

Comments

@oreporan
Copy link
Contributor

oreporan commented Sep 5, 2018

Based on issue found here #1374
--no-bail should return 1 if any of the commands failed, instead it returns 0 always.

Expected Behavior

if any tests/commands failed, adding --no-bail should not hide the exit code, instead it should return exit code 1 if any of the packages returned exit code 1

Current Behavior

swallows the errors and returns exit code 0

Steps to Reproduce (for bugs)

  1. create package with npm command "test" : "exit 1"
  2. call npm run test --no-bail
lerna.json

{
    "lerna": "2.11.0",
    "packages": [
        "packages/*",
        "web",
        "web/service_worker_container",
        "mobile",
        "packages/expert-feed/common/components/*",
        "packages/slash-commands/components/*"
    ],
    "version": "0.0.0",
    "npmClient": "yarn"
}

Context

Running CI will not allow developers see all the tests that failed, current workaround is to drop --no-bail

@evocateur
Copy link
Member

Yeah, it's tricky. I've been noodling about this for about an hour now.

Basically, instead of using --no-bail to control the reject option passed to execa, we (probably?) need to always pass { reject: false } and do our own accounting (including setting process.exitCode, if necessary) after all the executions resolve. At least, that's how I'm exploring it right now.

@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.