On Friday, August 7, 2015 at 8:55 AM, Bill Warner wrote:
> It's actually a wrapper cookbook that I'm testing. the cookbook includes my base cookbook for internal standards configuration which has a few community cookbooks as well as a few in house ones to get the base configs, users, monitoring, dns, host etc all set up. then it includes some community and in house cookbooks to personalize the target application such as kafka, cassandra or our in house apps.
>
> I have all the tests running with Vagrant now but due to some minor incompatibilities with docker (mainly not being able to write to /etc/hosts or /etc/resolv.conf, some of the cookbooks in the runlist always fail. if there was a way I could blacklist or stub those cookbooks I'd still be able to get a nearly full test much faster than I can currently with Vagrant.
>
> I may be able to do a custom rake task that would rewrite the Berksfile and point to empty cookbooks for those...not sure how else to test it.
You can detect that you’re on Docker with ohai (you’ll have to poke around for these attributes, I don’t recall what they are off-hand) and then put the logic into your wrapper cookbook. You could also do this via attributes. It’s maybe a tiny bit ugly to have that logic in non-test code, but you lose the ability to manage the run_list when you go to role cookbooks, so it’s your best option.
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.