fix: graceful exit using ctrl+C if not test are running#515
Conversation
dnephin
left a comment
There was a problem hiding this comment.
Thank you for the PR!
There's already a signal handler added in newSignalHandler. That forwards signals to tests so that the first Ctrl-c cancels the tests instead of exiting gotestsum.
I think this will need to integrate with that function somehow.
I managed to use same |
This will return exit code 0 if gotestsum is waiting for any changes and it is interrupted, otherwise if some tests are running using ctrl+c it interrputs the tests and exit with status 1. Closes gotestyourself#508
|
@ccoVeille i kept the interface, it is super useful in testing, I added a comment to explicty say this :D |
|
@dnephin if you have other concerns let me know :D |
|
@ccoVeille do you think i need other changes here? |
|
Nope, the PR is fine and could be merged by a maintainer according to me. |
This will return exit code 0 if gotestsum is waiting for any changes and
it is interrupted, otherwise if some tests are running using ctrl+c it
interrupts the tests and exit with status 1.
The refactoring here is for using a single context and propagate over the other processes/functions.
This way is more clear where we cancel and what we do in sub-fuction at the moment of finishing the context.
No double signlar handlers are created.
Closes #508