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

Only run the at_exit behaviors if the current PID matches the PID that called SimpleCov.start #377

Merged
merged 1 commit into from Mar 12, 2015

Conversation

coderanger
Copy link
Contributor

This handles the case where a test calls fork at some point, the new process shouldn't try to run coverage formatters or check the minimum coverage level.

This resolves #371.

…t called SimpleCov.start.

This handles the case where a test calls fork at some point, the new process shouldn't try to run coverage formatters or check the minimum coverage level.
@coderanger
Copy link
Contributor Author

Not sure whats up with that test failure, can't repro it locally.

@colszowka
Copy link
Collaborator

Great, thanks. Don't worry about the failing tests, we had an order issue there, see #362 - which should be resolved now that I've merged #376.

colszowka added a commit that referenced this pull request Mar 12, 2015
Only run the at_exit behaviors if the current PID matches the PID that called SimpleCov.start
@colszowka colszowka merged commit 8ec8168 into simplecov-ruby:master Mar 12, 2015
@grosser
Copy link
Contributor

grosser commented May 12, 2015

FYI this breaks using forking test runners with code coverage for example https://github.com/grosser/codeclimate_batch + https://github.com/grosser/forking_test_runner

not a big issue, just wanted you to be aware that this is a usecase / tell me if this looks wrong and I should be doing something else

fork do
  SimpleCov.pid = Process.pid
  ... run test ...
end

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.

Default code path doesn't appear to handle fork correctly?
3 participants