ruote log_2010-09-15

2010-09-15 02:48:48 utc marc_lee_ hi, does anyone know what's the best way of running some cukes against a rails app with ruote-kit?
2010-09-15 02:49:44 utc jmettraux marc_lee: hello
2010-09-15 02:49:59 utc marc_lee_ jmettraux: hi!
2010-09-15 02:50:15 utc jmettraux welcome on #ruote
2010-09-15 02:50:31 utc jmettraux not sure how you should proceed, capybara maybe ?
2010-09-15 02:50:42 utc marc_lee_ yeah am running capybara
2010-09-15 02:51:59 utc marc_lee_ we are initiating the run_worker! in a separate process for development, and i was wondering if starting a new thread for running it in cucumber is a good idea
2010-09-15 02:52:55 utc jmettraux ruote-lit 2.1.10 ?
2010-09-15 02:52:58 utc jmettraux kit
2010-09-15 02:53:30 utc marc_lee_ yup
2010-09-15 02:53:54 utc jmettraux ouch, Torsten and I are preparing 2.1.11 and it's a bit different
2010-09-15 02:53:59 utc marc_lee_ * ruote (2.1.10)
2010-09-15 02:53:59 utc marc_lee_ * ruote-kit (2.1.10)
2010-09-15 02:54:19 utc marc_lee_ yeah we're running ruby 1.9.2 too.
2010-09-15 02:55:12 utc jmettraux ACTION looking at the current rspec setting for rk proper
2010-09-15 02:55:20 utc marc_lee_ ta
2010-09-15 02:55:37 utc marc_lee_ thanks i mean
2010-09-15 02:55:51 utc jmettraux understood
2010-09-15 02:56:11 utc jmettraux http://github.com/jmettraux/ruote-kit/blob/master/spec/it_has_an_engine.rb
2010-09-15 02:56:58 utc jmettraux fresh engine for each spec, but I guess it's no realistic for you, rk core specs are ruote-kit centric and you are in a real application
2010-09-15 02:57:54 utc marc_lee_ yeah. we're trying to run an end to end test
2010-09-15 02:59:19 utc jmettraux ACTION looking at a real app
2010-09-15 03:00:17 utc jmettraux I have a rails app with ruote-kit in here, I'm using the same ruote engine for all the tests
2010-09-15 03:00:39 utc jmettraux but I call RuoteKit.engine.storage.clear before each test
2010-09-15 03:03:03 utc jmettraux it takes a bit of taming
2010-09-15 03:03:11 utc marc_lee_ oh ok
2010-09-15 03:03:34 utc marc_lee_ do you start the workers? or it's more like you start the engine in the tests?
2010-09-15 03:03:50 utc jmettraux I'd recommend switching to the latest ruote-kit, 2.1.11 is due out soon and it's quite a jump from 2.1.10
2010-09-15 03:03:58 utc jmettraux I let the [test] engine start the worker
2010-09-15 03:04:02 utc marc_lee_ yeah it is a huge jump.
2010-09-15 03:04:24 utc jmettraux jump : for ruote itself, not much of a jump, for ruote-kit it is
2010-09-15 03:04:46 utc marc_lee_ Any sample tests you could point me to? thanks in advance!
2010-09-15 03:05:27 utc jmettraux http://github.com/tosch/ruote-on-rails ouch, it has no tests
2010-09-15 03:06:15 utc jmettraux you could maybe check the env when initializing ruote-kit, if it's "test" you can start the worker altogether
2010-09-15 03:06:16 utc marc_lee_ hehe yeah. that was the first place i checked
2010-09-15 03:07:11 utc marc_lee_ how do you initialise ruote-kit in your setup? At the moment we're still running rake ruote:run_worker
2010-09-15 03:08:00 utc jmettraux ACTION gisting a config/initializers/ruote.rb ...
2010-09-15 03:08:46 utc marc_lee_ thanks
2010-09-15 03:09:39 utc jmettraux http://gist.github.com/580184
2010-09-15 03:10:13 utc jmettraux tosch's http://github.com/tosch/ruote-on-rails/blob/master/config/initializers/ruote_kit.rb
2010-09-15 03:11:11 utc marc_lee_ oh you run a cron process to periodically process the work items?
2010-09-15 03:11:38 utc jmettraux no no, it's a set of periodic processes
2010-09-15 03:11:43 utc jmettraux to be run each day
2010-09-15 03:11:57 utc jmettraux you can discard that part, it's a bit advanced
2010-09-15 03:12:33 utc jmettraux http://ruote.rubyforge.org/exp/cron.html (if you're really interested)
2010-09-15 03:13:06 utc jmettraux the daily participant does some checking on an external database and triggers new processes if necessary
2010-09-15 03:13:15 utc marc_lee_ thanks, no no, not too interested!
2010-09-15 03:13:15 utc jmettraux but that's all specific to that application
2010-09-15 03:13:43 utc marc_lee_ was trying to avoid cron if at all possible
2010-09-15 03:14:14 utc jmettraux it's ruote own cron, not /sbin/crond ;-)
2010-09-15 03:15:00 utc marc_lee_ ah...
2010-09-15 03:22:12 utc marc_lee_ does FSStorage have clear?
2010-09-15 03:22:57 utc jmettraux it has purge!
2010-09-15 03:23:19 utc marc_lee_ ah
2010-09-15 03:23:21 utc marc_lee_ ta
2010-09-15 03:23:22 utc marc_lee_ hehe
2010-09-15 03:23:49 utc marc_lee_ we would be using something else in the future, just using FS for the moment
2010-09-15 03:23:51 utc marc_lee_ =)
2010-09-15 03:24:22 utc jmettraux ACTION has to have the same method for all the storage impls
2010-09-15 03:25:00 utc marc_lee_ yes =)
2010-09-15 10:58:35 utc marc_lee_ hey jmettraux... i just noticed something
2010-09-15 10:59:45 utc marc_lee_ RUOTE_STORAGE = Ruote::FsStorage.new("ruote_work_#{Rails.env}"), it doesn't seem to adhere to the path. For some reason it seems to create one at "#{Rails.root}/work_#{Rails.env}" instead
2010-09-15 11:05:49 utc jmettraux it's depends on your cwd
2010-09-15 11:06:15 utc jmettraux it depends
2010-09-15 11:07:02 utc jmettraux ruote is not a rails plugin
2010-09-15 11:07:07 utc marc_lee_ huh? but I thought it should follow whatever's been specified in the initializer.rb?
2010-09-15 11:08:00 utc marc_lee_ RuoteKit.engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new("tmp/ruote_work_#{Rails.env}")))
2010-09-15 11:08:11 utc marc_lee_ oops i mean this, instead of the RUOTE_STORAGE constant
2010-09-15 11:08:29 utc marc_lee_ I thought it would have just stuck with this directory?
2010-09-15 11:08:57 utc tosch_le hello marc!
2010-09-15 11:09:05 utc marc_lee_ hi!
2010-09-15 11:09:09 utc tosch_le do you want to use ruote from inside rails?
2010-09-15 11:09:10 utc marc_lee_ sorry for troubling everyone
2010-09-15 11:09:13 utc jmettraux RuoteKit.engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new(Rails.root.join("tmp/ruote_work_#{Rails.env}")))
2010-09-15 11:09:23 utc marc_lee_ yeah been using ruote-kit in rails 3
2010-09-15 11:09:28 utc jmettraux now worries
2010-09-15 11:09:30 utc tosch_le never mind that, we're here to help and glad if we succeed in doing so
2010-09-15 11:09:31 utc jmettraux no worries
2010-09-15 11:09:49 utc tosch_le did you have a look at ruote-on-rails?
2010-09-15 11:09:51 utc marc_lee_ cool yeah i got it working with my cukes
2010-09-15 11:10:01 utc marc_lee_ i had a look at your ruote-rails-example
2010-09-15 11:10:03 utc marc_lee_ on github
2010-09-15 11:10:14 utc marc_lee_ oops it's threetee's
2010-09-15 11:10:15 utc tosch_le http://github.com/tosch/ruote-on-rails/tree/rails3
2010-09-15 11:11:03 utc marc_lee_ ah ok
2010-09-15 11:11:36 utc marc_lee_ hm i have been using 2.1.10
2010-09-15 11:11:46 utc marc_lee_ ruote-kit that is
2010-09-15 11:11:55 utc jmettraux ;-(
2010-09-15 11:12:09 utc marc_lee_ so i guess i should upgrade? heheh
2010-09-15 11:12:36 utc jmettraux ruote-kit 2.1.10 is massively behind
2010-09-15 11:12:56 utc tosch_le update should be fine
2010-09-15 11:13:14 utc tosch_le there is no release yet, but we're nearly there
2010-09-15 11:13:23 utc marc_lee_ yeah that's why we didn't go with 2.1.1
2010-09-15 11:13:28 utc marc_lee_ 2.1.11 i mean
2010-09-15 11:13:46 utc marc_lee_ so i should just grab the master?
2010-09-15 11:14:04 utc tosch_le you could try with the rails3 branch of ruote-on-rails as base
2010-09-15 11:14:12 utc tosch_le yes
2010-09-15 11:14:29 utc jmettraux tosch_le ? http://github.com/tosch/ruote-kit
2010-09-15 11:15:32 utc tosch_le marc_lee_: side note: use jmettraux's master, no the one at http://github.com/kennethkalmer/ruote-kit
2010-09-15 11:15:57 utc marc_lee_ so to reiterate, use kenneth's?
2010-09-15 11:16:39 utc jmettraux tosch or jmettraux, but not kenneth
2010-09-15 11:16:45 utc tosch_le don't use kenneth's, it's behind and will be updated on release
2010-09-15 11:16:49 utc marc_lee_ oh
2010-09-15 11:16:49 utc marc_lee_ ok
2010-09-15 11:17:23 utc tosch_le you may use jmettraux's or mine fork, i'm trying to keep them in sync and succeeded so far :-)
2010-09-15 11:17:31 utc marc_lee_ hehehe sure thing
2010-09-15 11:17:35 utc marc_lee_ i'll try using it now,
2010-09-15 11:17:50 utc marc_lee_ any changes i should be aware of? when I upgrade?
2010-09-15 11:17:57 utc marc_lee_ has the syntax changed quite a bit?
2010-09-15 11:18:09 utc tosch_le configuration is completely different
2010-09-15 11:18:21 utc tosch_le make sure you update ruote as well
2010-09-15 11:18:31 utc jmettraux bundle ftw
2010-09-15 11:19:12 utc marc_lee_ yeah bundler for sure
2010-09-15 11:19:31 utc marc_lee_ the doco on ruote.rubyforge.org is up-to-date for ruote-kit?
2010-09-15 11:19:48 utc jmettraux yes
2010-09-15 11:20:02 utc marc_lee_ awesome. trying now =)
2010-09-15 11:20:04 utc jmettraux the doc specific do ruote-kit is its README.txt
2010-09-15 11:20:14 utc marc_lee_ yup reading it
2010-09-15 11:20:55 utc marc_lee_ thanks guyes
2010-09-15 11:20:57 utc marc_lee_ argh
2010-09-15 11:20:59 utc marc_lee_ thanks guys i mean
2010-09-15 11:21:03 utc jmettraux you're welcome
2010-09-15 11:21:30 utc tosch_le if you're using ruote-on-rails: the Gemfile is already relying on a released rk 2.1.11 – you should re-insert the lines 22 and 23 dropped here: http://github.com/tosch/ruote-on-rails/commit/366aacd7c6379a5ac9542f3e3335712650f8fe3f#L1L22
2010-09-15 11:21:32 utc jmettraux don't hesitate to point at weaknesses in the doc, tosch_le and I will try to follow and make it better
2010-09-15 11:21:52 utc marc_lee_ ok
2010-09-15 11:22:55 utc tosch_le (gnarf, i really should update ruote-on-rails, rails 3 is not now for a couple of days…)
2010-09-15 11:23:04 utc tosch_le s/not/out/
2010-09-15 11:23:06 utc marc_lee_ hehe yeah i saw the rc in that =)
2010-09-15 11:24:27 utc tosch_le anyway, there are not much changes needed in a vanilla rails to include ruote-kit
2010-09-15 11:25:01 utc tosch_le the changes i have done in ruote-on-rails concern the Gemfile, the initializer and the rake task in lib/tasks
2010-09-15 11:25:03 utc marc_lee_ true true.
2010-09-15 11:25:13 utc marc_lee_ maybe add some test examples =)
2010-09-15 11:25:50 utc tosch_le no time for that, feel free to fork away.
2010-09-15 11:25:57 utc tosch_le ;-)
2010-09-15 11:26:19 utc marc_lee_ I was thinking of that but was hesitating on mentioning it as I am time-poor too =).
2010-09-15 11:26:29 utc marc_lee_ will try
2010-09-15 11:26:48 utc tosch_le threetee's repo you mentioned is a living example, iirc it's based on ruote-on-rails
2010-09-15 11:28:03 utc marc_lee_ ah ok
2010-09-15 11:29:19 utc tosch_le coming back to your original problem: please try using edgy rk and ruote and report back after that
2010-09-15 11:29:28 utc tosch_le :-)
2010-09-15 11:29:33 utc marc_lee_ will do =)
2010-09-15 13:30:07 utc marc_lee_ ok, the Ruote::FsStorage.new("location") now works in the initializers!
2010-09-15 13:31:01 utc tosch_le fine
2010-09-15 13:31:20 utc tosch_le thanks for updating and the patience :-)
2010-09-15 13:31:34 utc marc_lee_ but how do i run a worker in my cukes? I think I must have gotten it wrong when i thought it ran ok
2010-09-15 13:31:57 utc marc_lee_ hehe it's all good on that front, just the cukes now frustrating me.
2010-09-15 13:32:24 utc tosch_le hmm, not using rk with cucumber yet
2010-09-15 13:32:54 utc tosch_le workaround would be to use a worker by default and not just the one started with the rake task
2010-09-15 13:33:38 utc tosch_le or you set RuoteKit.engine to an engine set with worker when initializing cucumber
2010-09-15 13:34:00 utc tosch_le unfortunately, i can't remember where that should be done
2010-09-15 13:37:26 utc jmettraux running the worker inside of the engine should do it Ruote::Engine.new(Ruote::Worker.new(storage))
2010-09-15 13:37:56 utc marc_lee_ yeah i'm doing that already, as in RuoteKit.engine = Ruote::Engine.new(Ruote::Worker.new(RUOTE_STORAGE))
2010-09-15 13:38:34 utc tosch_le are you sure that isn't overwritten somewhere?
2010-09-15 13:38:46 utc marc_lee_ hm. don't think so. stock standard
2010-09-15 13:39:23 utc marc_lee_ i activate the process with a RuoteKit.engine.launch PDEF_ACTION, { :doc_id => id}
2010-09-15 13:40:11 utc tosch_le wild guess: you're cukes are too fast for the engine
2010-09-15 13:40:13 utc marc_lee_ unless i run the worker in the rake task separately, it doesn't register the workitem? (am i using the right terminology)
2010-09-15 13:40:26 utc tosch_le no, it depends
2010-09-15 13:40:42 utc marc_lee_ ah. hm. let me set a sleep and see, least i could do
2010-09-15 13:40:58 utc tosch_le the way you "register" the engine, there should be a worker and everything should be fine
2010-09-15 13:41:14 utc tosch_le the rake task is only needed when you register the engine without a worker
2010-09-15 13:41:18 utc marc_lee_ ok
2010-09-15 13:42:23 utc tosch_le even if there is no worker, no launched process is lost, they will be visible next time a worker is started
2010-09-15 13:42:55 utc marc_lee_ yup. have observed that.
2010-09-15 13:44:36 utc tosch_le :-)
2010-09-15 13:45:32 utc tosch_le there is a way to wait for the engine to finish it's work, have a look at ruote-kit's specs for more info, can't recall it just now
2010-09-15 13:46:01 utc tosch_le a way other than sleep, to be more precise
2010-09-15 13:50:56 utc jmettraux you can wait for a participant
2010-09-15 13:51:15 utc jmettraux engine.wait_for(:participant_name_as_a_symbol)
2010-09-15 13:51:29 utc jmettraux this blocks until a workitem shows up for that particiant
2010-09-15 13:51:31 utc jmettraux participant
2010-09-15 13:53:46 utc marc_lee_ oh ok i'll try that
2010-09-15 13:54:20 utc marc_lee_ yeah i did do the sleep, didn't work =P
2010-09-15 13:55:21 utc jmettraux what are you trying to do ? gist ?
2010-09-15 13:57:13 utc jmettraux probably an error showed up under ruote_work_xxx/errors/
2010-09-15 14:00:02 utc marc_lee_ hold on, will check
2010-09-15 14:00:37 utc marc_lee_ no errors
2010-09-15 14:00:56 utc marc_lee_ trying the engine.wait_for for now
2010-09-15 14:01:27 utc jmettraux don't hesitate to gist your test, it's hard to help you blindly
2010-09-15 14:01:50 utc marc_lee_ i understand =)
2010-09-15 14:02:21 utc marc_lee_ all i honestly did was 'then I sleep for "120" seconds' so it isn't worth gisting hehe
2010-09-15 14:03:17 utc jmettraux anything under ruote_work_xxx/ ? nothing under .../msgs/ ?
2010-09-15 14:07:10 utc marc_lee_ there are 00 - 12 empty folders in msgs
2010-09-15 14:07:25 utc jmettraux what does your process look like ?
2010-09-15 14:09:30 utc marc_lee_ https://gist.github.com/db73b2c7c4e1c65ce80d
2010-09-15 14:09:40 utc marc_lee_ that's my feature, initializer, steps
2010-09-15 14:10:43 utc jmettraux How does the verify stage look like ?
2010-09-15 14:11:38 utc marc_lee_ just adding that. forgot to add that =/
2010-09-15 14:11:51 utc marc_lee_ same url, pls reload
2010-09-15 14:12:58 utc jmettraux what does PDEF_CREATED look like ?
2010-09-15 14:13:19 utc marc_lee_ argh i should remember to put it heheh
2010-09-15 14:14:38 utc marc_lee_ ok done
2010-09-15 14:16:21 utc marc_lee_ it does work on dev. just on test, it's hm either too slow or not working
2010-09-15 14:17:03 utc marc_lee_ there are work items on it too
2010-09-15 14:17:05 utc marc_lee_ on test
2010-09-15 14:17:30 utc jmettraux ok
2010-09-15 14:17:59 utc jmettraux well
2010-09-15 14:18:22 utc jmettraux engine.wait_for(:verify) will block until a workitem enters the participant "verify"
2010-09-15 14:18:29 utc jmettraux not when it leaves
2010-09-15 14:18:59 utc jmettraux does verified! trigger ?
2010-09-15 14:19:34 utc marc_lee_ yup it did trigger
2010-09-15 14:19:36 utc tosch_le do you run the tests with a rake task?
2010-09-15 14:19:55 utc jmettraux what are the symptoms with sleep and the symptoms with engine.wait_for(:verify) ?
2010-09-15 14:20:01 utc marc_lee_ nope, capybara/selenium with g chrome
2010-09-15 14:20:26 utc marc_lee_ sleep was just a long wait and the document is still in the queue. by right it shouldn't be visible. as per dev
2010-09-15 14:21:02 utc jmettraux what is the queue ?
2010-09-15 14:21:43 utc marc_lee_ queue as in my list of documents, i.e. all the documents to be verified
2010-09-15 14:21:53 utc jmettraux (maybe marc is better off with a state machine, it seems only about managing the lifecycle of documents)
2010-09-15 14:22:30 utc jmettraux (sorry, I meant Marc)
2010-09-15 14:22:45 utc marc_lee_ jmettraux: not really, we'll be expanding the process further, am only in iteration 2.... this is just the initial bit =)
2010-09-15 14:22:53 utc jmettraux ok
2010-09-15 14:22:58 utc marc_lee_ jmettraux: (more complex stuff coming)
2010-09-15 14:23:17 utc jmettraux it seems your test is working fine
2010-09-15 14:23:45 utc marc_lee_ the wait_for doesn't seem to stop the test at all and the document wasn't processed. so it seems
2010-09-15 14:24:38 utc jmettraux so verified! didn't work ?
2010-09-15 14:28:45 utc jmettraux marc_lee_: you should go over for a coffee at brain_in_vat's place, he did ruote + cucumber
2010-09-15 14:28:52 utc jmettraux Melbourne connection
2010-09-15 14:29:22 utc marc_lee_ it is called and did do what it's supposed to *scratch head*
2010-09-15 14:29:34 utc jmettraux ouch
2010-09-15 14:29:34 utc marc_lee_ yeah i know brain_in_vat well =)
2010-09-15 14:30:14 utc jmettraux what's the symptom of "the document wasn't processed" ?
2010-09-15 14:32:10 utc marc_lee_ an inspection of the workitem in verified! did return a json
2010-09-15 14:32:40 utc jmettraux so the reply failed ?
2010-09-15 14:32:58 utc jmettraux or are you asking too early ?
2010-09-15 14:33:43 utc jmettraux wait_for is probably better used to block until a workitem reaches the participant, no to block until it has left the participant
2010-09-15 14:34:06 utc marc_lee_ hm. that's weird. the position is completed
2010-09-15 14:34:15 utc marc_lee_ it did move on from verified when i check _ruote
2010-09-15 14:35:03 utc jmettraux sorry for all this "head wrapping"
2010-09-15 14:35:35 utc marc_lee_ hahah it's ok, don't tell me it's because i didn't purge the FS??!
2010-09-15 14:36:50 utc jmettraux no clue, but "oh f*k my test used the workitem of the previous test" are known sources of wtf
2010-09-15 14:37:14 utc marc_lee_ yeah i'm starting to suspect so. sorry in advance if it is!
2010-09-15 14:37:57 utc jmettraux no worries
2010-09-15 14:41:35 utc marc_lee_ where's the best place to put the purge! though, conditional if statement in the initialisers?
2010-09-15 14:42:23 utc jmettraux in the "teardown"
2010-09-15 14:42:27 utc marc_lee_ ok
2010-09-15 14:42:40 utc jmettraux or rather in the test "setup"
2010-09-15 14:42:48 utc jmettraux start with a clean slate
2010-09-15 14:55:42 utc marc_lee_ ok my bad. it's hm. *hides* my thinking sphinx setup that might be at fault.
2010-09-15 14:56:47 utc jmettraux OK
2010-09-15 14:57:32 utc marc_lee_ will update it and will have to contribute to the example with a working cuke test as an atonement
2010-09-15 14:57:34 utc marc_lee_ hehe
2010-09-15 14:57:41 utc jmettraux lol
2010-09-15 14:58:10 utc jmettraux that reminds me I have to fix the wiki, I nuked while attempting to move it to gollum
2010-09-15 15:02:59 utc jmettraux tosch_le: how's the PHP going ?
2010-09-15 15:03:00 utc tosch_le oh yeah, i think i will include a worker in the default ruote-on-rails setup soon – there's going to be a PassengerMinInstances in passenger: http://blog.phusion.nl/2010/07/29/the-road-to-passenger-3-technology-preview-4-adding-new-features-and-removing-old-limitations/
2010-09-15 15:03:13 utc jmettraux cool !
2010-09-15 15:03:17 utc tosch_le as fine as possible
2010-09-15 15:10:13 utc tosch_le ACTION is slightly drooling – there'll be out-of-the-box rvm support in passenger 3: http://blog.phusion.nl/2010/09/15/phusion-passenger-3-0-0-public-beta-1-is-out/
2010-09-15 15:11:25 utc jmettraux excellent