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

Merged
merged 1 commit into from Mar 1, 2016

Conversation

Projects
None yet
4 participants
@danmactough
Contributor

danmactough commented Mar 1, 2016

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.

Fix calling process.exit with "ok" exit code
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

This comment has been minimized.

johnelliott commented Mar 1, 2016

👍

1 similar comment
@brownstein

This comment has been minimized.

brownstein commented Mar 1, 2016

👍

rhys-vdw added a commit that referenced this pull request Mar 1, 2016

Merge pull request #1238 from danmactough/fix-process-exit-on-error-w…
…ith-ok-error-code

Fix calling process.exit with "ok" exit code

@rhys-vdw rhys-vdw merged commit 69a61fb into tgriesser:master Mar 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rhys-vdw

This comment has been minimized.

Collaborator

rhys-vdw commented Mar 1, 2016

Good catch, thanks.

@danmactough

This comment has been minimized.

Contributor

danmactough commented Mar 1, 2016

np. Thanks for the quick merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment