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

SIGINT is indistinguishable from a failed test #209

Closed
johnrichardrinehart opened this issue Aug 12, 2021 · 0 comments · Fixed by #210
Closed

SIGINT is indistinguishable from a failed test #209

johnrichardrinehart opened this issue Aug 12, 2021 · 0 comments · Fixed by #210
Labels
enhancement New feature or request

Comments

@johnrichardrinehart
Copy link

johnrichardrinehart commented Aug 12, 2021

Description

I run gotestsum in a loop in a bash script. In order to detect SIGINT in the bash script I have to inspect the exit code of gotestsum (I think). However, <ctrl-c> during test processing triggers an exit code of 1.

$ gotestsum . # hit <ctrl-c> immediately
$ echo $?
1

The same exit code happens if tests fail.

So, I can't terminate my testing loop based on SIGINT - checking if $? = 1 will treat failed tests the same way as SIGINT.

I recommend having failed tests keep $? = 1. But, OS signals should have $? > 1. This makes it easy to predicate on both signals and failed tests.

Update

I've submitted #210 to address this.

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

Successfully merging a pull request may close this issue.

2 participants