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

[RRFC] An option to stop after the first fail when running a script in workspaces #602

Closed
rpominov opened this issue Jun 17, 2022 · 4 comments

Comments

@rpominov
Copy link

Motivation ("The Why")

I use npm run build-and-test --workspaces in a CI. If the script fails in one of the workspaces, it can be difficult to find the error in the CI log as it's followed by the output of the successful runs in the other workspaces.

How

Current Behaviour

There's no way that I know of to tell the cli to stop execution after the first fail.

Desired Behaviour

There's an option like --fail-fast.

References

  • n/a
@Twipped
Copy link

Twipped commented Jun 17, 2022

I literally JUST ran afoul of this exact problem. Test failures at package levels aren't halting CI workflows because --workspaces doesn't relay the error code.

@rpominov
Copy link
Author

rpominov commented Jun 19, 2022

In my experience, it does relay the error code, just doesn't exit immediately. I believe the relevant code is here:

https://github.com/npm/cli/blob/f2340f816f5a137038945229bf8a0d30160e76e8/lib/commands/run-script.js#L205-L227

If it exits with 0 code for you, updating npm may help.

@thescientist13
Copy link

I think this may be related to #575 , which has has some good conversations around this kind of behavior during the weekly meetings and so I think there is good traction on that issue. (I noticed it has been tagged for release 8.x 👀 )

@rpominov
Copy link
Author

Ah, great. I couldn't find an existing issue. This is a duplicate then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants