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

introduce --first option #27

Closed
wants to merge 1 commit into from

Conversation

andrenarchy
Copy link

With --first, all child processes are terminated after the first child process terminated (regardless of the exit code). The exit code of the parent process is the exit code of the child process that terminated first.

The option makes sense, e.g., in the setting of e2e tests where you start a http server process and then run tests against the http server. When the test process terminates, also the http server should be killed. For example:

parallelshell --first 'npm run http-server' 'npm run http-tests'

The exit code of the parallelshell process then is the exit code of the http-tests process.

With --first, all processes are terminated after the first process
terminated (regardless of the exit code). The exit code is the exit code
of the process that terminated first.
@keithamus
Copy link
Collaborator

Hey @andrenarchy thanks for the PR 😄

Looks pretty good - but do you want to add some tests for it? Then I'll happily give this a merge.

@andrenarchy
Copy link
Author

I'm currently trying to write tests. However, I don't get why the exit code is 2 in all tests. Where does the 2 come from?

@keithamus
Copy link
Collaborator

I think failingProcess exits with 2. Im not entirely sure though, @paulpflug added proper unit tests so he might be able to tell you 😄

@paulpflug
Copy link
Collaborator

you have to use the unit tests of #25. The others are faulty, sorry for that.

@paulpflug
Copy link
Collaborator

I merged it into dev with #29
I will create a test now 👍
Thanks for contributing @andrenarchy

@paulpflug paulpflug closed this Jul 29, 2015
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

Successfully merging this pull request may close these issues.

3 participants