-
Notifications
You must be signed in to change notification settings - Fork 631
Run the full test suite in pure ruby CI #1006
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
Run the full test suite in pure ruby CI #1006
Conversation
@sodabrew @MSP-Greg I'd totally forgotten that In the main branch:
In this PR:
|
Treating My immediate goal isn't to work through that TODO list, it's just to make sure the "ratchet" is in place so we don't regress. My longer term goal is to get my existing EventMachine services either migrated to a modern gem, or to modernize EventMachine enough that I don't care any more. 😉 I figure that both goals are aided by getting more of the pure ruby implementation working. In my opinion, much of the C++ code can and should eventually be converted to ruby, except where is is significant for performance of course. |
This look fantastic. I'd like to merge it as-is, just note if you think you're still working on it or ready to land! |
@sodabrew Thanks! Yeah, for this PR I'm not going to worry about omit vs pend. It's good to go from my end. |
... thinking some more:
I'm using GitHub and GitLab code search to see if this is a common pattern, I did find a few: |
Thanks for taking that next step. Yeah, this is the potential issue. So I looked at all of the examples, and also searched for
But there's a deeper reason I think we're okay: pretty close to no one should be using pure ruby mode for very much today... or if they are, they're dealing with lots and lots of bugs already (whether they known it or not), and that's regardless of whether or not they are using Additionally, most of the stubbed methods are either undocumented or documented as |
The tests have been updated with "pend" or "omit", so the test suite should still pass (albeit with a long "TODO list" in the output).
There's no longer any special reason to single out just these tests, so this rake task is obsolete.
53847f9
to
dfb76cc
Compare
@sodabrew I still think it's safe for the reasons given, but its not completely risk-free, so I'm also fine with putting that part off for a future PR. I've removed almost all of the stubs. The only stub methods this PR adds now are the ones related to epoll and kqueue, so There are still many files that check
(Somewhat ironically, the test suite seems to make more assertions when the methods are missing.) |
This stubbing is just enough to get the rest of the test suite running. It should be safe, as `EM.kqueue?` and `EM.epoll?` already exist for feature detection. The implementation here basically mimics the implementation in ext/rubymain.cpp.
dfb76cc
to
a6cbdf1
Compare
Many of these may be trivial to implement in pure ruby mode, and some may be impossible, but for right now I'd prefer to simply have them all displayed as a "TODO list" in the test results.Of course, adding these stub methods breaks many tests that were omitted based on whether or notEM
responds to these methods.All of the failing tests have been marked as pending, including the ones that failed when stub methods were added and raised EM::Unsupported. Where the tests failed due to an EM::Unsupported error, the name of the stubbed method has been added to the pending message. This should simplify finding tests to un-pend, if and when pure ruby mode is fixed to support these features.
Additionally, CI for pure ruby mode has been updated to run the entire test suite--albeit with 90 tests marked as pending. This should allow us to "ratchet" pure ruby mode forward.
The major downsideA minor tradeoff of this PR is thatThis has been moved into another PR.EM.respond_to?(method)
is no longer a reliable feature detection mechanism. (see the comment below for an analysis of this issue)