On Mon, Apr 14, 2014 at 07:05:49AM -0700, Alexander Fortin wrote: > On Sunday, April 13, 2014 11:57:19 AM UTC+2, Johan De Wit wrote: > > > > I still am so surprised when asking who is doing some kind of 'testing', > > almost nobody raises is hand ..... > > > > Most people just don't' see the sense of doing rspec unit tests - why > > writing the same code twice ? > > > > Well, I think there is still a lot of talking to do .... > > > > > Hi Johan, > > sorry for the missed presentation at Puppet User Group Berlin, I'll make it > one day or another and I'll share the slides at least ;) > > I'll be very happy to discuss further the testing topic, because testing is > also very important to us. Actually we do lots of testing on our manifests > (but not with rspec) and catalogs, and precisely I think that puppet > catalog-diff [1] is the key piece in the pipeline for us, because it shows > us for real what's actually changing with every commit we push to our > manifests, plus the noop runs before merging to prod give us the final safe > net to be sure we don't get any unexpected change in production. For the > last 8 months or so it's been working surprisingly well for us and I'm > really willing to share our experience with the community and also getting > and suggestions about how to improve it even further. > > By the way, I'm another one that's not so convinced about the rspec tests > value, to me seems that the unit tests themselves are much less relevant > for a declarative-like language like Puppet. I mean, there's no 'design' > that has to emerge by the unit tests getting green, in our team we already > share a defined design for module structure, and, say, if the coder write > the spec for a file to be there, I don't see why I should trust that more > than a definition of that same thing in the manifest itself, hence the > feeling of code duplication with no real value added.
I see the value of using rspec in TDD just because I can then go back and refactor the manifests properly. I haven't used catalog-diff but I am suspecting that it might be a substitute for the rspec tests. Tell me does it provide the following: * Automatic runs through guard/rake/whatever on every commit to verify that I am not breaking things like permissions on files * Does it work on the catalog semantic level or syntactic level - what I mean by that is that if I have defined 4 files in a class each with the same user/group/mode and I move those into default parameters for the File resource in the scope - will it detect that I am not changing anything? * Will I be able to test that things haven't changed once I move to another puppet version - let's say the default mode for directories change in the next major puppet version? > > What I can see very clearly for normal software development, those values > coming from TDD, I can't see easily for Puppet manifests writing. Something > like Beaker [2] is what we'd like to add to our testing pipeline, i.e. > running tests for the full stack in a VM, but again, stil more then willing > to change my mind about rspec-puppet ;) Beaker with http://serverspec.org/ is quite nice - note that I am still not using it long enough to complain(waiting it to happen :)) > > [1] https://github.com/ripienaar/puppet-catalog-diff > [2] https://github.com/puppetlabs/beaker/wiki/Overview > > -- > http://about.me/alexanderfortin -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20140415072556.GB24790%40nikolavp-desktop. For more options, visit https://groups.google.com/d/optout.
