Friday, 2010-08-13

[2010/08/13 00:30:33] @ Log started by gepetto
[2010/08/13 00:30:33] @ ohookins joined channel #puppet-dev
[2010/08/13 02:05:41] @ Quit: ricky: Quit: Lost terminal
[2010/08/13 02:06:35] @ ricky joined channel #puppet-dev
[2010/08/13 04:47:47] <ohookins> i'm trying to write some simple spec tests, but i'm really out of my depth here, is anyone around who could help me?
[2010/08/13 04:59:45] <stevenjenkins> what do you need?
[2010/08/13 05:00:05] <stevenjenkins> or, rather, what are you needing to test?
[2010/08/13 05:06:37] <stevenjenkins> (you're probably afk...): a general suggestion: look over the tests in spec/unit for examples. If you're modifying an existing part of Puppet, there will almost certainly already be unit tests for the component you're working on, so start from those.
[2010/08/13 05:08:41] <stevenjenkins> and one item that confused me (and I think is still true): Puppet uses Mocha, and the behavior of mocks is different from vanilla Rspec because of that. This blog post may be helpful to you in that respect: http://www.paperplanes.de/2007/12/14/mocha_and_rspec_dont_play.html
[2010/08/13 05:10:48] <stevenjenkins> and, yes, cf puppet/spec/spec_helper.rb:36 config.mock_with :mocha
[2010/08/13 05:10:48] <stevenjenkins> so you'll be using Mocha mocks instead of Rspec's.
[2010/08/13 05:17:58] <ohookins> stevenjenkins: i need to add a new test for the yum provider to get a new feature accepted, but actually there are no yum tests at all yet
[2010/08/13 05:18:17] <ohookins> stevenjenkins: so far all i have working is the basic "should be versionable" test
[2010/08/13 05:18:55] <stevenjenkins> have you looked at spec/unit/provider/package/apt_spec.rb ?
[2010/08/13 05:19:06] <ohookins> yes, and it confuses the hell outta me
[2010/08/13 05:19:47] <ohookins> i'm also not sure if all of the concepts of apt apply to yum, i can't seem to do a reasonable copy/paste between the two
[2010/08/13 05:20:43] <stevenjenkins> I doubt that a cut and paste approach would work well, but looking at the actual tests would give you an idea of where to start.
[2010/08/13 05:21:14] <stevenjenkins> have you at least written out the tests you think are reasonable? (e.g., it "should do this"..it "should do that"...etc)
[2010/08/13 05:21:35] <stevenjenkins> ignoring for a moment the question of 'what do the bodies of the tests need to do'?
[2010/08/13 05:22:41] <ohookins> since there were no tests to begin with, i want to limit the amount of new tests i add to keep the scope of my patch more or less to the new functionality that is required
[2010/08/13 05:23:18] <ohookins> so basically i'd like to leave the "is versionable" since it already works, get the basic "can install" test working and one for the new feature
[2010/08/13 05:23:42] <ohookins> it's for #2866
[2010/08/13 05:23:42] <gepetto> ohookins: #2866 is http://projects.puppetlabs.com/issues/show/2866 "Puppet - Feature #2866: Yum package provider does not allow downgrade - Puppet Labs"
[2010/08/13 05:25:52] <stevenjenkins> looks like this apt test might be a starting point for you: it "should specify the package version if one is asked for" do
[2010/08/13 05:26:58] <stevenjenkins> ah, so all you're really doing is calling :downgrade
[2010/08/13 05:27:36] <ohookins> for that, i'd like to ensure that when it already has an installed package, and we want to install an earlier version, it calls downgrade rather than install/upgrade
[2010/08/13 05:28:05] <ohookins> you can take that as more or less my rspec test language
[2010/08/13 05:29:05] <ohookins> i think the mocha mock aspect definitely has confused me, i had some idea that might have been the case but i was still looking at the rspec mock docs thinking "this doesn't look right"
[2010/08/13 05:29:41] <stevenjenkins> yeah, I banged my head on that for days a few yrs back before someone (lak, ethanrowe, etc) set me straight.
[2010/08/13 05:30:04] <stevenjenkins> oh, I see one of your problems: no yum spec tests at all.
[2010/08/13 05:30:26] <ohookins> yes
[2010/08/13 05:30:44] <ohookins> there's not even anything to build on, which makes the barrier to getting something working harder for me
[2010/08/13 05:30:48] * stevenjenkins nods.
[2010/08/13 05:31:11] <ohookins> i think i understand the basic concepts, but the interaction of all of the objects has me very confused
[2010/08/13 05:31:21] <stevenjenkins> basic question: what branch are you working off of? ie, I'll branch at the same place and put some skeleton together for you.
[2010/08/13 05:31:34] <ohookins> i have that fairly common block up the top which creates a stub resource and stub provider but i'm not sure if i'm using it correctly
[2010/08/13 05:31:54] <ohookins> at the moment i'm working from 0.25.5
[2010/08/13 05:31:59] <ohookins> i'll pastie what i have for you
[2010/08/13 05:32:34] <ohookins> http://pastie.org/1090287
[2010/08/13 05:34:57] <stevenjenkins> looking at it..give me about 10 mins..
[2010/08/13 05:36:12] <ohookins> thanks very much
[2010/08/13 05:42:54] <stevenjenkins> ah. there's a bug in the provider...
[2010/08/13 05:43:21] <stevenjenkins> at least as far as my test is concerned.
[2010/08/13 05:45:13] <ohookins> what kind of bug?
[2010/08/13 05:45:34] <stevenjenkins> should = @resource.should(:ensure) vs should = @resource[:ensure]
[2010/08/13 05:46:33] <ohookins> which is correct? the latter?
[2010/08/13 05:46:50] <stevenjenkins> the latter is what the apt provider uses..and passes its test
[2010/08/13 05:47:32] <stevenjenkins> I'm getting a no such method for nilclass error in my test, though, so still looking at it.
[2010/08/13 05:54:30] <stevenjenkins> cf http://pastie.org/1090316
[2010/08/13 05:55:16] <stevenjenkins> still has errors, but more useful ones..
[2010/08/13 05:56:05] <stevenjenkins> and I need to run to a conf call. feel free to ask more questions, though
[2010/08/13 05:56:15] <ohookins> does that require the change to the actual provider?
[2010/08/13 05:57:20] <stevenjenkins> not quite sure what the different approaches for settting 'should' are.
[2010/08/13 05:57:35] <stevenjenkins> ie, I havent looked in the src much over the past yr.
[2010/08/13 05:58:14] <stevenjenkins> once the West Coasters come on, you might ask about that.
[2010/08/13 05:58:24] <stevenjenkins> or ping masterzen
[2010/08/13 05:59:22] <ohookins> i'll check out some other resource types and see what's what
[2010/08/13 05:59:25] <ohookins> thanks for your help!
[2010/08/13 05:59:53] <stevenjenkins> you're welcome
[2010/08/13 06:09:01] @ Quit: fsweetser: Ping timeout: 246 seconds
[2010/08/13 06:13:45] @ fsweetser joined channel #puppet-dev
[2010/08/13 07:19:53] <ohookins> the next step in my ruby/rspec/mocha journey: can someone tell me what is meant by :[] ?
[2010/08/13 07:35:48] @ Log started by gepetto
[2010/08/13 07:35:48] @ Joined channel #puppet-dev
[2010/08/13 07:35:48] @ Topic is "http://projects.reductivelabs.com"
[2010/08/13 07:35:48] @ Topic set by ReinH!~reinh@li14-106.members.linode.com on Wed Mar 17 16:29:56 -0700 2010
[2010/08/13 07:35:51] @ Mode +cnt by verne.freenode.net
[2010/08/13 07:40:20] @ Log started by gepetto
[2010/08/13 07:40:20] @ Joined channel #puppet-dev
[2010/08/13 07:40:20] @ Topic is "http://projects.reductivelabs.com"
[2010/08/13 07:40:20] @ Topic set by ReinH!~reinh@li14-106.members.linode.com on Wed Mar 17 16:29:02 -0700 2010
[2010/08/13 07:40:23] @ Mode +cnt by gibson.freenode.net
[2010/08/13 07:43:05] @ rcrowley joined channel #puppet-dev
[2010/08/13 08:26:08] @ ohookins left channel #puppet-dev ("Leaving.")
[2010/08/13 08:26:34] @ stahnma_ is now known as stahnma
[2010/08/13 08:28:15] @ takamichi joined channel #puppet-dev
[2010/08/13 08:32:57] @ jmccune joined channel #puppet-dev
[2010/08/13 08:33:36] @ takamichi left channel #puppet-dev ()
[2010/08/13 09:06:07] @ Quit: jmccune: Ping timeout: 246 seconds
[2010/08/13 09:20:01] @ jmccune joined channel #puppet-dev
[2010/08/13 09:49:19] @ unixdaemon joined channel #puppet-dev
[2010/08/13 09:49:59] <unixdaemon> If someone has a moment can you have a look at this patch and see if it's worth sending to the dev mailing list please?
[2010/08/13 09:50:02] <unixdaemon> http://github.com/deanwilson/puppet/commit/92dd1e7bca68c0de2012f4d5682f40432cb0efe8
[2010/08/13 09:59:04] @ Quit: jmccune: Ping timeout: 276 seconds
[2010/08/13 10:18:33] @ plathrop is now known as plathrop-away
[2010/08/13 10:43:32] @ notbrien joined channel #puppet-dev
[2010/08/13 10:43:43] @ plathrop-away is now known as plathrop
[2010/08/13 10:45:41] @ Quit: notbrien: Client Quit
[2010/08/13 11:53:18] @ lak joined channel #puppet-dev
[2010/08/13 11:55:45] @ Quit: lak: Client Quit
[2010/08/13 13:05:58] <jamesturnbull> unixdaemon: it's always worth sending - rake mail_patches - that's in fact the best place to get feedback
[2010/08/13 13:06:57] <jamesturnbull> unixdaemon: you know you can just specify --keylength right?
[2010/08/13 13:28:36] <masterzen> jamesturnbull: I still don't have access to the CLA link in redmine. I must be blind :-)
[2010/08/13 13:44:14] @ lak joined channel #puppet-dev
[2010/08/13 13:48:06] <jamesturnbull> masterzen: top right hand menu bar? right at the top of the screen? :)
[2010/08/13 15:05:10] @ Quit: fsweetser: Ping timeout: 265 seconds
[2010/08/13 15:05:54] @ fsweetser joined channel #puppet-dev
[2010/08/13 15:32:53] @ Quit: lak: Quit: lak
[2010/08/13 16:05:58] @ lak joined channel #puppet-dev
[2010/08/13 16:47:12] @ Quit: lak: Quit: lak
[2010/08/13 17:46:23] @ nlew joined channel #puppet-dev
[2010/08/13 19:39:49] @ plathrop is now known as plathrop-away
[2010/08/13 20:25:03] @ lak joined channel #puppet-dev
[2010/08/13 20:42:07] @ Quit: lak: Quit: lak
[2010/08/13 20:56:42] @ nlew left channel #puppet-dev ()

Generated by irclog2html.py 2.6 by Marius Gedminas - find it at mg.pov.lt!