On May 6, 2009, at 12:45 AM, Paul Nasrat wrote:
>
> 2009/5/5 Sam Rowe <[email protected]>:
>>
>> I talked with Luke on the phone about this and he suggested that this
>> code is acceptable.
>
> Could you possibly write tests for this, using canned data so if say
> the format of things change it's easy to fix.
It's pretty tough to write tests for facts - you can't retrieve an
individual resolution.
I talked with Sam about it a bit yesterday, and basically, he's
duplicated the structure of the AIX code, which is a reasonable first
try. I'd recommended refactoring to push all of the logic into the
resolution, but then you'd need to cache data (to avoid running the
manifest command for every fact value) and Facter has no simple
caching system yet.
So, I figured that while this isn't great, it does at least add a bit
more hpux support and isn't any worse than anything else we have.
We really need to add the ability to uniquely identify and retrieve
resolutions, so we can test those individual resolutions.
>
> For some examples see eg spec/unit/util/ip.rb
This would require abstraction into a library, and the ip library is
already ahving performance problems because there's no caching - the
ip data is collected many, many times. One client says Facter can
take up to 25% of run time because of all the ip stuff.
>
> Also Luke can you give this a +1
+1 :)
--
Life isn't fair. It's just fairer than death, that's all.
-- William Goldman
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---