ruote log_2010-10-22

2010-10-22 00:18:30 utc fixr I'm off, bye guys!
2010-10-22 00:19:19 utc jmettraux hassox: wait_for is unfortunately only a test helper method
2010-10-22 00:20:31 utc jmettraux so I guess that what you see is the engine stop the only thread around (no worker thread) to wait for process to terminate
2010-10-22 00:20:36 utc jmettraux and it complains...
2010-10-22 00:20:44 utc hassox almost gettting exciting now
2010-10-22 00:21:00 utc hassox that's col
2010-10-22 00:21:01 utc hassox cool
2010-10-22 00:21:01 utc hassox that's where I'm using it
2010-10-22 00:21:12 utc hassox ja
2010-10-22 00:21:30 utc hassox when I added a worker it went through
2010-10-22 00:21:51 utc hassox I need to work out how to do this properly now
2010-10-22 00:22:04 utc jmettraux did you see my tweet to you the other day http://twitter.com/#!/jmettraux/status/27911662603 ?
2010-10-22 00:22:20 utc jmettraux (just wondering since you asked about wait_for)
2010-10-22 00:23:53 utc hassox I did thanx :D
2010-10-22 00:23:58 utc jmettraux :-)
2010-10-22 00:24:05 utc hassox I've been using that as a guide to setup this stuff
2010-10-22 00:24:26 utc jmettraux great
2010-10-22 00:29:52 utc hassox jmettraux: when I've done the wait_For
2010-10-22 00:29:57 utc hassox how can I see if it errored?
2010-10-22 00:30:18 utc jmettraux engine.process(wfid).errors
2010-10-22 00:30:21 utc jmettraux or
2010-10-22 00:30:26 utc jmettraux engine.errors(wfid) IIRC
2010-10-22 00:30:58 utc jmettraux engine.errors(wfid).first.message
2010-10-22 00:32:27 utc hassox ACTION gives it a crack
2010-10-22 00:32:55 utc hassox hrm
2010-10-22 00:32:55 utc hassox ok
2010-10-22 00:32:57 utc hassox no errors
2010-10-22 00:33:05 utc hassox but also not hading over to the particpiant :(
2010-10-22 00:33:30 utc jmettraux what does the pdef look like ? (private is OK)
2010-10-22 00:34:54 utc jmettraux RuoteKit.engine.noisy = true # makes the engine (worker) verbose and noisy over stdout, it's useful sometimes
2010-10-22 00:37:15 utc hassox sent
2010-10-22 00:37:15 utc hassox the error array is empty after the wait_fo
2010-10-22 00:37:16 utc hassox for
2010-10-22 00:38:17 utc hassox lemme gist
2010-10-22 00:38:31 utc hassox https://gist.github.com/2480fa23e5f180f65f21
2010-10-22 00:38:37 utc hassox jmettraux:
2010-10-22 00:40:26 utc hassox I can't see a file that it's storing it in :\
2010-10-22 00:42:05 utc jmettraux not necessarily
2010-10-22 00:42:34 utc jmettraux some people have a final participant call
2010-10-22 00:42:45 utc jmettraux final process step
2010-10-22 00:42:56 utc hassox https://gist.github.com/2480fa23e5f180f65f21
2010-10-22 00:42:59 utc hassox jmettraux: the new output
2010-10-22 00:43:02 utc hassox it just hangs there
2010-10-22 00:43:34 utc hassox and it's not firing the participant :|
2010-10-22 00:45:00 utc jmettraux line 7-9 of your gist indicate that your participants are registered as Ruote::StorageParticipant
2010-10-22 00:45:11 utc jmettraux what does your participant registration code look like ?
2010-10-22 00:47:05 utc hassox pm
2010-10-22 00:47:25 utc jmettraux in your fsstorage directory
2010-10-22 00:47:59 utc hassox ?
2010-10-22 00:47:59 utc jmettraux please nuke the confgurations folder
2010-10-22 00:48:13 utc jmettraux there is probably an old version of the participant list in there
2010-10-22 00:49:02 utc hassox champion!
2010-10-22 00:49:19 utc jmettraux I tend to nuke the complete storage before each test
2010-10-22 00:49:25 utc hassox ok
2010-10-22 00:49:28 utc hassox I'll do that
2010-10-22 00:49:49 utc jmettraux storage.purge!
2010-10-22 00:50:30 utc hassox :)
2010-10-22 01:05:19 utc hassox bugger
2010-10-22 01:05:29 utc hassox doesn't work so good in rails spec jmettraux
2010-10-22 01:05:35 utc hassox the thread must use another connection
2010-10-22 01:05:41 utc hassox so no access to the current transaction :(
2010-10-22 01:06:25 utc jmettraux sorry about that
2010-10-22 01:07:06 utc jmettraux you could say do_not_thread returns true, and that would use the thread of the worker
2010-10-22 01:07:13 utc jmettraux but
2010-10-22 01:07:26 utc jmettraux if your worker isn't inside of your rails application
2010-10-22 01:07:48 utc jmettraux you definitively don't have the same session/transaction with the db
2010-10-22 01:09:06 utc hassox yeah it's inside the rails app
2010-10-22 01:09:12 utc hassox but isn't the worker running in it's own thread?
2010-10-22 01:09:32 utc jmettraux yes
2010-10-22 01:09:43 utc jmettraux IIRC, rails gives you one connection per thread
2010-10-22 01:09:46 utc hassox yeah so, it's in a different thread to the specs anyway yeah
2010-10-22 01:09:52 utc jmettraux (activerecord)
2010-10-22 01:09:55 utc hassox ja
2010-10-22 01:10:14 utc hassox so I can't fire off a worker in a spec, and have it access the transaction can i?
2010-10-22 01:10:54 utc jmettraux I guess you could, but that would require grabbing the main thread and its connection
2010-10-22 01:12:00 utc jmettraux what in the extreme case where the workers are in other ruby runtimes ?
2010-10-22 01:12:28 utc hassox I'm just trying to work out how to spec this
2010-10-22 01:12:30 utc jmettraux if you expect everybody to share the same transaction, you can't farm out stuff
2010-10-22 01:15:08 utc hassox yeah I was hoping to have the engine / worker be very simple for the specs
2010-10-22 01:15:21 utc hassox but I can't even set expectations on the participant
2010-10-22 01:15:24 utc hassox I need to rethink this
2010-10-22 01:15:42 utc jmettraux you're assuming all the participants to share the same "transaction" ?
2010-10-22 01:16:04 utc hassox only in my specs
2010-10-22 01:16:17 utc hassox I am just tring to find a way of writing my specs that describe the behavior of them
2010-10-22 01:16:36 utc jmettraux ok
2010-10-22 03:38:40 utc hassox jmettraux: hey mate
2010-10-22 03:38:41 utc hassox still about?
2010-10-22 03:38:48 utc jmettraux hello, yes, still around
2010-10-22 03:38:52 utc hassox hey
2010-10-22 03:38:59 utc hassox still trying with these specs mate
2010-10-22 03:39:14 utc hassox trying to inspect the first workitem in the following
2010-10-22 03:39:55 utc hassox https://gist.github.com/2480fa23e5f180f65f21
2010-10-22 03:40:35 utc hassox when I do this
2010-10-22 03:40:36 utc jmettraux are you trying to inspect it when it reaches the participant or leaves it or ?
2010-10-22 03:40:45 utc hassox @wfid = @engine.launch subject.new_account, :account_id => account_id
2010-10-22 03:40:51 utc hassox @engine.wait_for(1)
2010-10-22 03:40:56 utc hassox workitem = @engine.storage_participant.all
2010-10-22 03:40:59 utc hassox I get an empty list
2010-10-22 03:41:17 utc jmettraux your participants are not storage participants
2010-10-22 03:41:22 utc jmettraux they are "custom" participants
2010-10-22 03:41:39 utc jmettraux so they won't store a workitem in there
2010-10-22 03:41:54 utc hassox hrm
2010-10-22 03:42:05 utc jmettraux and @engine.wait_for(1) returns after the worker does 1 step
2010-10-22 03:42:05 utc hassox so how can I check what's in the process definition?
2010-10-22 03:42:20 utc jmettraux so at that point the flow won't have reached any participant
2010-10-22 03:42:47 utc jmettraux I'd suggest a) testing the participants by themselves
2010-10-22 03:43:05 utc jmettraux b) testing processes by looking at what happens after they've run
2010-10-22 03:44:19 utc jmettraux in a) there is no process running, you're just feeding a workitem to the consume method of the participant and ensuring it works as specified
2010-10-22 03:44:34 utc jmettraux in b), well it's an integration test
2010-10-22 03:45:57 utc hassox hrm
2010-10-22 03:45:59 utc hassox ok
2010-10-22 03:46:02 utc hassox but...
2010-10-22 03:46:07 utc hassox that's what I was trying to do
2010-10-22 03:46:22 utc hassox the participant couldn't find the account, because the account was inside a transaction on the d
2010-10-22 03:46:23 utc hassox db
2010-10-22 03:46:33 utc hassox so the worker being on another connection, can't find it
2010-10-22 03:47:01 utc hassox I just want to make sure that the participant receives the message that it's supposed to
2010-10-22 03:47:15 utc hassox but I can't mock either
2010-10-22 03:47:31 utc jmettraux you can't registrate a mock participant ?
2010-10-22 03:47:40 utc hassox hrm
2010-10-22 03:47:45 utc hassox lemme see
2010-10-22 03:48:00 utc jmettraux (implementing a dummy participant)
2010-10-22 03:49:35 utc hassox I've tried to stub out new on my participant class, but the stub seems to only work inside the thread I'm in
2010-10-22 03:49:55 utc jmettraux aaaah
2010-10-22 03:50:35 utc jmettraux how about registering something like engine.register_participant 'account_defaults', 'MyDummyParticipant' ?
2010-10-22 03:50:55 utc jmettraux for each delivery to a participant, ruote will instantiate the participant
2010-10-22 03:51:26 utc hassox so have a test participant that just records what's called?
2010-10-22 03:51:29 utc jmettraux instances are bound to runtimes
2010-10-22 03:51:32 utc jmettraux yeah, why not
2010-10-22 03:51:37 utc jmettraux a stub
2010-10-22 03:52:26 utc hassox can I get hold of the participant for an engine?
2010-10-22 03:52:41 utc jmettraux not really
2010-10-22 03:54:26 utc hassox how do you do it?
2010-10-22 03:54:29 utc hassox in a rails app?
2010-10-22 03:54:47 utc jmettraux get hold of the participant ?
2010-10-22 03:55:46 utc hassox no, I mean how do you test your process definitions in a rails app
2010-10-22 03:56:24 utc jmettraux I have a well known application state at the beginning
2010-10-22 03:56:29 utc jmettraux then I launch the process
2010-10-22 03:56:54 utc jmettraux if it's a fully automated process, when the process is over, I check to see if the expectations
2010-10-22 03:56:58 utc jmettraux the changes in the application state
2010-10-22 03:57:03 utc hassox but... do your participants not need db access?
2010-10-22 03:57:03 utc jmettraux are realized
2010-10-22 03:57:15 utc jmettraux some of them do
2010-10-22 03:57:19 utc hassox how do you deal with the transaction issue?
2010-10-22 03:57:49 utc jmettraux if I pass a reference to a record to a participant, I expect it to exist
2010-10-22 03:58:11 utc jmettraux ie the transaction in which it got created got committed before the workitem reaches the participant
2010-10-22 03:58:18 utc hassox hrm
2010-10-22 03:58:30 utc hassox that's not how rspec behaves for me :(
2010-10-22 03:58:36 utc hassox it runs each example in a transacton
2010-10-22 04:00:03 utc jmettraux OK, I guess I will have to build a bench
2010-10-22 04:00:19 utc hassox maybe I'm approaching this wrong
2010-10-22 04:00:42 utc hassox really, in this spec, I am trying to test the structure of my process definition
2010-10-22 04:01:24 utc hassox to make sure that the 'command' param, the 'account_id' field and the participant are what I'm expecting
2010-10-22 04:01:32 utc hassox the rest, I will spec elsewhere
2010-10-22 04:02:02 utc jmettraux so you need to have config.use_transactional_fixtures = true in your spec helper ?
2010-10-22 04:02:09 utc hassox I have that
2010-10-22 04:02:28 utc jmettraux what if you turn it off just for one spec run ?
2010-10-22 04:02:31 utc hassox is there any way I can say "this process should have AccountDefaults participant called with "/foo/bar"
2010-10-22 04:03:08 utc jmettraux I do that kind of thing with a trace array
2010-10-22 04:03:09 utc hassox praps
2010-10-22 04:03:27 utc hassox so have a global array, and add to it in the participant?
2010-10-22 04:03:35 utc hassox if ENV == test ?
2010-10-22 04:03:38 utc jmettraux class Participant; def consume(workitem); $trace << "hello"; reply_to_engine(workitem); end; end
2010-10-22 04:03:53 utc jmettraux just a mock/stub participant
2010-10-22 04:04:05 utc hassox I think you may have just given me an idea
2010-10-22 04:05:25 utc jmettraux I use a similar technique for testing the process definitions in ruote itself
2010-10-22 04:37:21 utc hassox jmettraux: so re-registering the participant doesn't do the job :(
2010-10-22 04:38:00 utc jmettraux I thought you'd register the "trace participiants" instead of the regular participants
2010-10-22 04:38:23 utc hassox jmettraux: I did
2010-10-22 04:38:26 utc hassox and my appologies
2010-10-22 04:38:31 utc jmettraux ?
2010-10-22 04:38:33 utc hassox it does re-register it :D
2010-10-22 04:38:43 utc jmettraux ah great
2010-10-22 04:39:13 utc jmettraux :-)
2010-10-22 04:41:01 utc hassox awesome :D
2010-10-22 04:41:04 utc hassox that's done the job
2010-10-22 04:41:10 utc hassox now I can test to see what's happened
2010-10-22 04:41:18 utc jmettraux woot !
2010-10-22 05:02:00 utc hassox jmettraux: motoring along now :D
2010-10-22 05:02:01 utc hassox thanx
2010-10-22 05:02:10 utc jmettraux great, you're welcome
2010-10-22 07:36:35 utc kennethk_ jmettraux: hello !
2010-10-22 07:36:41 utc kennethk_ you subscribed to rack-devel ?
2010-10-22 07:36:44 utc tosch_le hello kenneth!
2010-10-22 07:36:45 utc jmettraux no
2010-10-22 07:36:46 utc jmettraux hello
2010-10-22 07:36:54 utc kennethk_ getting thread for you
2010-10-22 07:36:58 utc kennethk_ hi tosch_le
2010-10-22 07:37:43 utc kennethk_ http://groups.google.com/group/rack-devel/browse_thread/thread/32312e78f42351f0
2010-10-22 07:38:10 utc jmettraux :-) great, thanks !
2010-10-22 07:38:20 utc kennethk_ pleasure
2010-10-22 07:39:15 utc tosch_le oh, great!#
2010-10-22 07:41:16 utc tosch_le kennethk_: wondering if i should remove the kit.rubyforge.org links from rk's readme
2010-10-22 07:41:27 utc kennethk_ yeah, please do
2010-10-22 07:41:42 utc kennethk_ i'll realize those good intentions in the future :)
2010-10-22 07:41:59 utc tosch_le :)
2010-10-22 07:51:29 utc jmettraux tosch_le: may I nuke the prototype stuff in ruote-on-rails/public/javascripts/ ?
2010-10-22 07:52:22 utc tosch_le yes, but wait a few minutes until i have pushed my changes regarding the rails template and the worker included in the rails process by default now
2010-10-22 07:52:40 utc jmettraux ok, I'll rebase
2010-10-22 07:54:09 utc tosch_le pushed
2010-10-22 07:55:45 utc jmettraux many thanks !
2010-10-22 07:55:48 utc tosch_le the rails app template is now at ruote-kit
2010-10-22 07:55:55 utc jmettraux :-)
2010-10-22 08:00:52 utc jmettraux pushed on both fronts (rk, rr)
2010-10-22 08:03:59 utc tosch_le pulled :) thanks!
2010-10-22 08:05:17 utc jmettraux dropped the "TheBoard" name
2010-10-22 08:05:53 utc tosch_le we should update the readme then
2010-10-22 08:06:06 utc jmettraux please do ;-)
2010-10-22 08:06:14 utc tosch_le tomorrow
2010-10-22 08:06:20 utc tosch_le no, monday
2010-10-22 08:06:43 utc jmettraux I'll give it a look, maybe I'll fix it meanwhile
2010-10-22 08:07:21 utc tosch_le i'd like you to have a look at the readme anyway, especially the bit on ruote workers
2010-10-22 08:08:21 utc jmettraux OK, then I won't touch it
2010-10-22 08:09:07 utc tosch_le ? you shall touch it, especially if there's something wrong.
2010-10-22 08:09:27 utc jmettraux OK
2010-10-22 08:43:16 utc jmettraux tosch_le: pumping your oxygen a bit, but I was wondering about lauching processes in ruote-on-rails
2010-10-22 08:43:37 utc jmettraux what about putting some sample process definition in a repo, and enumerating them
2010-10-22 08:43:38 utc jmettraux ?
2010-10-22 08:53:36 utc tosch_le what do you mean with repo? why not include them in ruote-on-rails?
2010-10-22 08:57:40 utc jmettraux yes, sorry, I meant a folder
2010-10-22 08:58:21 utc jmettraux not in the db
2010-10-22 08:58:41 utc jmettraux (I could even place the forms in a folder and altogether avoid db use)
2010-10-22 08:59:11 utc tosch_le db use for the forms is ok, i think, after all, it's a rails example app
2010-10-22 08:59:32 utc jmettraux what about the sample defs ?
2010-10-22 08:59:37 utc tosch_le +1 for process defs in a folder
2010-10-22 08:59:50 utc jmettraux ok
2010-10-22 09:11:04 utc gonzalo hi
2010-10-22 09:11:20 utc tosch_le hi
2010-10-22 09:11:39 utc gonzalo anyone using logback witin ruby?
2010-10-22 09:11:43 utc gonzalo within
2010-10-22 09:12:22 utc gonzalo sorry within ruote
2010-10-22 09:12:24 utc jmettraux http://logback.qos.ch/ ?
2010-10-22 09:12:32 utc jmettraux gonzalo: hello !
2010-10-22 09:12:46 utc gonzalo hi john
2010-10-22 09:13:14 utc gonzalo i'm thinking in logging my processes with logback
2010-10-22 09:13:44 utc gonzalo maybe a listener could do this job... ?¿
2010-10-22 09:13:54 utc jmettraux what do you want to log ?
2010-10-22 09:14:14 utc gonzalo well, for example, an invalid user authentication
2010-10-22 09:14:47 utc jmettraux eh, do you login via ruote ?
2010-10-22 09:14:57 utc gonzalo not exactly
2010-10-22 09:15:12 utc jmettraux using logback should be as easy as using any java lib from jruby
2010-10-22 09:15:14 utc gonzalo i'm working on a process that lends bikes
2010-10-22 09:15:31 utc gonzalo a user sends it iButton
2010-10-22 09:15:32 utc jmettraux cool, tosch_le will love that
2010-10-22 09:15:44 utc gonzalo and the workflow checks if it is a valid user
2010-10-22 09:15:55 utc jmettraux aah
2010-10-22 09:16:17 utc jmettraux 2 variants : a) log from your participants (after all you implemented them)
2010-10-22 09:16:18 utc gonzalo so if someone uses an invalid iButton 64 bit number it gets logged
2010-10-22 09:16:43 utc jmettraux b) log the worker activity (inspiration : http://github.com/jmettraux/ruote/blob/ruote2.1/lib/ruote/log/storage_history.rb )
2010-10-22 09:16:50 utc jmettraux b) is probably too much
2010-10-22 09:17:36 utc tosch_le gonzola: is this by any chance related to bicing (http://www.bicing.cat/)?
2010-10-22 09:18:36 utc gonzalo well not exactly bicing.cat
2010-10-22 09:18:42 utc gonzalo but a system of the kind
2010-10-22 09:18:54 utc gonzalo probably competitors :)
2010-10-22 09:19:25 utc tosch_le i suppose i'd write an own LogParticipant which get's triggered on error (or in another way in the pdef)
2010-10-22 09:20:00 utc gonzalo cool, it would be nice to have a participant for logging
2010-10-22 09:20:25 utc gonzalo i'll think on your suggestions... many thanks guys!
2010-10-22 09:21:52 utc jmettraux you're welcome
2010-10-22 10:58:38 utc codebeaker good afternoon gents
2010-10-22 11:06:02 utc tosch_le hello codebeaker!
2010-10-22 15:26:51 utc phaeron Hello everyone
2010-10-22 15:27:35 utc phaeron does this : _if '${test_success}' do check the __result__ field of the work item from the previous participant ?
2010-10-22 15:29:26 utc lbt_ see http://ruote.rubyforge.org/dollar.html but I can't see anywhere that the 'special' result is used
2010-10-22 15:30:39 utc lbt_ ah http://ruote.rubyforge.org/rdoc/Ruote/Workitem.html#method-i-result
2010-10-22 15:31:14 utc phaeron so __result__ is a special field
2010-10-22 15:31:56 utc lbt_ yes... but the docs say "This field is used by the if expression for instance to determine if it should branch to its ‘then’ or its ‘else’."
2010-10-22 15:32:15 utc lbt_ but I'm not sure of the syntax... it's not mentioned in the expressions page
2010-10-22 21:41:01 utc hassox morning guys
2010-10-23 00:01:37 utc hassox good morning jmettraux
2010-10-23 00:01:46 utc jmettraux hassox: good morning to you
2010-10-23 00:01:51 utc hassox how are you dude?
2010-10-23 00:02:15 utc jmettraux doing fine, had my espresso, you ?
2010-10-23 00:02:47 utc hassox yeah pretty good
2010-10-23 00:02:53 utc hassox got lots of hacking done yesterday
2010-10-23 00:03:17 utc hassox still having trouble trying to spec / integrate into features with route
2010-10-23 00:03:20 utc hassox ruote
2010-10-23 00:03:25 utc jmettraux :-(
2010-10-23 00:03:30 utc hassox ja
2010-10-23 00:03:52 utc jmettraux how can I help ?
2010-10-23 00:03:59 utc hassox I hope you can ;)
2010-10-23 00:04:29 utc hassox I'm trying to include this into my cucumber features
2010-10-23 00:04:35 utc hassox so I've got this step definition
2010-10-23 00:05:11 utc hassox RuoteKite.engine.wait_for(*RuoteKit.engine.process_wfids)
2010-10-23 00:05:20 utc hassox I've got that running after my seeds
2010-10-23 00:05:29 utc hassox but it just hangs :(
2010-10-23 00:05:49 utc hassox I've printed out all the processes, and one has an error (broken pipe)
2010-10-23 00:05:56 utc hassox but I told it to break on error
2010-10-23 00:06:56 utc hassox I have no idea what I'm doing wrong :(
2010-10-23 00:07:12 utc jmettraux let me point you to something
2010-10-23 00:07:25 utc jmettraux wait_for more of a testing feature
2010-10-23 00:07:36 utc jmettraux best used in conjunction with a TestLogger
2010-10-23 00:07:42 utc jmettraux the change is minimal
2010-10-23 00:08:21 utc jmettraux this is how I instantiate the engine (and worker) when doing func tests : http://github.com/jmettraux/ruote/blob/ruote2.1/test/functional/base.rb#L27-31
2010-10-23 00:08:40 utc jmettraux I override the service logger with a TestLogger
2010-10-23 00:08:56 utc jmettraux if you could try that with your cucumber engine/worker
2010-10-23 00:09:15 utc jmettraux you only have to change at instantiation time, no other changes involved
2010-10-23 00:09:39 utc hassox kkk
2010-10-23 00:09:41 utc hassox sec
2010-10-23 00:10:24 utc jmettraux Ruote::FsStorage.new('directory', opts)
2010-10-23 00:10:41 utc jmettraux where opts is { 's_logger' => [ 'ruote/log/test_logger', 'Ruote::TestLogger' ] }
2010-10-23 00:12:38 utc hassox is ruote/loc/test_logger the path to the log file?
2010-10-23 00:13:12 utc jmettraux yes, as passed to a require or a load