Skip to content

Use exit instead of exit! to kill master - #36

Closed
konk303 wants to merge 1 commit into
tmm1:masterfrom
konk303:exit_master_without_bang
Closed

konk303 wants to merge 1 commit into
tmm1:masterfrom
konk303:exit_master_without_bang

Conversation

@konk303

@konk303 konk303 commented Mar 30, 2016

Copy link
Copy Markdown

So it plays nicely with at_exit (especially of simplecov).

While finishing forked processes with exit! is a safe
idea (to ensure killing child processes), master process doesn't really
needs to be forcely killed.

refs #35

So it plays nicely with `at_exit` (especially of `simplecov`).
While finishing forked processes with `exit!` is a good
idea (to ensure killing child processes), master process doesn't really
needs to be forcely killed.

http://ruby-doc.org/core-2.3.0/Kernel.html#method-i-exit

See https://github.com/colszowka/simplecov/blob/v0.11.2/lib/simplecov/defaults.rb#L52
  for how `simplecov` creates result at very last of the test suite.
@tmm1

tmm1 commented Mar 30, 2016

Copy link
Copy Markdown
Owner

This seems reasonable, however I think there can be some issue with minitest autorun's usage of at_exit, which would cause tests to run again after test-queue finishes.

@tmm1

tmm1 commented Mar 30, 2016

Copy link
Copy Markdown
Owner

Would it be possible for you to use the summarize hook to invoke SimpleCov manually?

@nakamura-rni

Copy link
Copy Markdown

@tmm1 thx for response!

Would it be possible for you to use the summarize hook to invoke SimpleCov manually?

yeah after I wrote this PR I thought it through, and came up with https://gist.github.com/konk303/0f32019c7fc0d1119b5936888ecb9884/revisions

Looks pretty clean and reasonable 😃
(had slight problem with defining Simplecov.at_exit, but I think it has nothing to do with test-queue)

Although I still feel killing master with non-bang-exit is a descent way, pls feel free to close this.

(Maybe I should be writing wiki on how to configure with simplecov?)

@aroben

aroben commented Mar 9, 2017

Copy link
Copy Markdown
Collaborator

@konk303 It'd be great to get that info into the wiki. I think @tmm1 is right that moving to exit! is problematic due to how minitest/autorun works.

@aroben aroben closed this Mar 9, 2017
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.

4 participants