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

drb support #2

Closed
dchelimsky opened this issue Mar 5, 2010 · 21 comments
Closed

drb support #2

dchelimsky opened this issue Mar 5, 2010 · 21 comments

Comments

@dchelimsky
Copy link
Contributor

Add a --drb command line switch with an option for specifying port.

@ashmoran
Copy link

I'm working on this

@ashmoran
Copy link

This will require a change and some extensions to Spork: http://github.com/timcharper/spork/issues/issue/27

The relevant issue to RSpec is what interface to expose for Spork. I've done a bit of refactoring to RSpec (unpushed) to separate DRb execution from in-process execution, but it's definitely not yet in a good state.

This is a little harder than I expected due to RSpec API changes. I was hoping to avoid forking Spork, but I can't see an elegant way to integrate the two otherwise, due to the way Spork loads its TestFramework adapters.

@ashmoran
Copy link

I'm making good progress on this. The code in my branch is still a bit of a mess as I find my way around, but functionality is moving forwards (the existing specs and features still pass). Hopefully tomorrow I'll have RSpec in a good enough state I can start making the patches to Spork. How much I'll oscillate between the two to integrate them, however, is anyone's guess. I only have tomorrow morning to work on this really, and a busy weekend, so there's a chance it won't be done until Monday.

The only major interface change I can think of so far is Rspec::Core::Runner#run now takes the output and error streams.

The biggest obstacle I've come up against is the use of singleton Configuration and World objects. Because the DRb specs run examples inside themselves (in the same process), this demands a bit of instance variable surgery to prevent interference. I can see the appeal of the class methods for the configuration, but I suspect they will need decoupling from the Runner instances somehow.

@dchelimsky
Copy link
Contributor Author

What if those methods accepted an optional scope argument?

Rspec.configure :scope => :drb do; end
Rspec.configuration :scope => :drb

Would that help?

@ashmoran
Copy link

Yes I think that would work! It would have to be possible to overwrite/reset a configuration in a scope. Then the code would either have to select the configuration before creating the runner, or pass the scope into it for the Runner to look it up (easier, can't say if it'd be better or not).

@rsanheim
Copy link
Contributor

Commenting so I get updates on this -- spork for Rails 3 would be great.

@dchelimsky
Copy link
Contributor Author

Hey Ashley, Rob, et al - been focusing what little spare time I have to getting the rspec-rails dev environment to work better so others can contribute. That's in a good spot, so I'll plan on focusing on spork integration this week.

@ashmoran
Copy link

Thanks David - I've been consumed by client work (what I'm doing right now in fact) - and it's been playing on my mind that this has been sitting as WIP for so long. I think by and large all the pieces are there, but it needs serious refactoring on both sides!

@dchelimsky
Copy link
Contributor Author

I won't have time to look at this until later today at the earliest - are all of the pieces in github repos that I can see?

@ashmoran
Copy link

Yep, in feature branches in my branches of rspec-core and spork. I've updated the Spork ticket with a note too just FYI (in case you aren't watching that ticket): http://github.com/rspec/rspec-core/issues/issue/2

Relevant branches:

http://github.com/ashleymoran/rspec-core/tree/issue_2_drb_support
http://github.com/ashleymoran/spork/tree/issue_27_rspec2_support

@dchelimsky
Copy link
Contributor Author

Great. Thanks. I'll follow up soon (in a day or so).

@rrouse
Copy link

rrouse commented May 13, 2010

Any update on this?

@ashmoran
Copy link

I haven't done anything more on it recently. Unfortunately, I've been fully booked by a client on a Rails 2.3 project, which is taking up all my coding time. I'll happily resume when that quiets down, but there's no indication that will be soon.

@dchelimsky
Copy link
Contributor Author

This will be resolved before rails-3 goes final. Hopefully sooner, but this is clearly a must have.

@dchelimsky
Copy link
Contributor Author

OK - this is my main priority right now. Ashley, I merged your changes to a branch (http://github.com/rspec/rspec-core/tree/issue_2_drb_support), but a LOT has changed in rspec-core since you wrote them, so things are a bit of a mess right now (specs run, but lots of failures and odd output). Ping me in #rspec on freenode if you have a chance. Until then, I'll keep plugging at this.

@dchelimsky
Copy link
Contributor Author

Fixed!!!!! Merged!!!!!! Thanks @ashleymoran:

http://github.com/rspec/rspec-core/commit/f99c34ea2fa02ae2d6e02cc68505a3f5114f30f6

I've made a number of changes since to get things to work, and I'm still refactoring a bit more, but I got it to a point where it seemed like a good idea to merge to master. Release coming soon.

@ashmoran
Copy link

ashmoran commented Jun 3, 2010

Lol, no worries, I think you did the hard work making it work after I let my code had rust for who knows how long! I may at some point come back to refactor the ugly bits I cobbled together...

@ashmoran
Copy link

ashmoran commented Jun 3, 2010

Just glad to know when I get back to Rails 3 I'll have Spork to play with :-)

@rsanheim
Copy link
Contributor

Hey should this be closed now, or is it still in progress?

@dchelimsky
Copy link
Contributor Author

Closed - are you experiencing any trouble?

@rsanheim
Copy link
Contributor

No, haven't tried it yet. I just have problems understanding what current status is from github issues sometimes. :)

This issue was closed.
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

No branches or pull requests

4 participants