Skip to content

Conversation

guerinoni
Copy link

@guerinoni guerinoni commented Jul 28, 2025

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

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@guerinoni
Copy link
Author

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 context as a starting point, and later other ctx are created starting from that, it seems good now

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
@guerinoni
Copy link
Author

@ccoVeille i kept the interface, it is super useful in testing, I added a comment to explicty say this :D

@guerinoni guerinoni requested a review from ccoVeille September 6, 2025 17:58
@guerinoni
Copy link
Author

@dnephin if you have other concerns let me know :D

@guerinoni
Copy link
Author

@ccoVeille do you think i need other changes here?

@ccoVeille
Copy link

Nope, the PR is fine and could be merged by a maintainer according to me.

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.

Graceful Exit for --watch Mode

3 participants