You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
simplecov.rb - fix Process monkey patch for fork when unsupported - #932
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much and sorry for the oversight!
I'll merge so it can go into the next release, however if you could post what the problem is that occurs I'd be happy. We're running tests on JRuby and they didn't fail so it must be a gap in our tests that'd like to fill and fix.
Sorry. I was/am working on coverage for an app that runs on Ubuntu/macOS/Windows both MRI & JRuby. It uses fork, and the test suite has tests for that.
Rather than using platform/OS conditionals, we've always preferred using ::Process.respond_to? :fork, as it's clear what the intent is. When we load simplecov, it patches Process, regardless of whether Ruby supports it.
First time I ran coverage, was a little surprised to see the fork tests running on JRuby & Windows...
JFYI, the app (Puma) has parallel tests, tests starting Puma via IO.popen, and the popen processes are running fork. Not sure if it's running correctly yet. There's coverage for the popen processes, but not sure about the forks.
I did need to prepend into SimpleCov::Result#format! to shut off the output, as sometimes we're testing the io returned by IO.popen. I think that made sense...
Also, re CI, stable.yml could easily add a Windows job, and since ruby/setup-ruby@v1 now has ruby head builds on all platforms, unstable.yml could use those. Several repos test against those head builds, some not even using allow-failure...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Monkey patching
Process.forkcauses issues with applications that make use of fork but also run on Ruby builds without fork (like Windows & JRuby).Fix so
./simplecov/process.rbis only required if the platform supportsProcess.fork.