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

Fix calling process.exit with "ok" exit code #1238

Conversation

danmactough
Copy link
Contributor

We have a helper to log an error message to the console and exit the process. It looks like the only place we use this helper is when we try and fail to initialize the driver.

Unfortunately, when we call process.exit() without an exit code, it exits with a 0 exit code -- which means success.

This is especially a problem when running tests in a CI environment, as it results in a false positive: tests not only do not pass, but they probably didn't even run.

We have a helper to log an error message to the console and exit the process. It looks like the only place we use this helper is when we try and fail to [initialize the driver](https://github.com/tgriesser/knex/blob/5a94bc9b178d399e23a80ff396a0fc7ec01ecc9b/src/client.js#L159).

Unfortunately, when we call `process.exit()` without an exit code, it [exits with a `0` exit code](https://nodejs.org/api/process.html#process_process_exit_code) -- which means success.

This is especially a problem when running tests in a CI environment, as it results in a false positive: tests not only do not pass, but they probably didn't even run.
@johnelliott
Copy link

👍

1 similar comment
@brownstein
Copy link

👍

rhys-vdw added a commit that referenced this pull request Mar 1, 2016
…ith-ok-error-code

Fix calling process.exit with "ok" exit code
@rhys-vdw rhys-vdw merged commit 69a61fb into knex:master Mar 1, 2016
@rhys-vdw
Copy link
Member

rhys-vdw commented Mar 1, 2016

Good catch, thanks.

@danmactough
Copy link
Contributor Author

np. Thanks for the quick merge.

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.

None yet

4 participants