Sun, May 10, 2015
I recently integrated a gem into a project at work that used Faraday for some internal stuff. The main thing to understand is that I had to prevent any Faraday errors from bubbling up to the top level project. As such, I attempted to mock out some of the Faraday methods to return exceptions and ensure they were being handled correctly. That may not have been the right thing to do in terms of testing, as it meant I was mucking about in the internals of our external gem dependency.
Sat, Apr 25, 2015
I found myself needing to ensure a gem was installed during compile time in a chef run, and which would then become available during convergence. After driving around the googlemobile for a while, I finally found Seth Vargo’s breakdown of the issue.
In addition, in Chef 12.1, there are some changes to the way the chef_gem resource operates 1. While this came up as something to pay attention to, our infrastructure is still operating on chef 11.
Sat, Apr 18, 2015
One of the first questions that I had when I started using Chef, after coming from a background with Puppet, was: are there any best practices or community norms that provide good guidelines about how cookbooks should be written in order to facilitate cookbook interaction?
The Chef community has really seemed to buy into the wrapper cookbook pattern. Part of the impetus is to provide small bits of reusable code that can be easily modified via attributes, or, in some cases, to codify organizational standards.
Sat, Apr 4, 2015
I use Chef at work, and I’ve recently embarked on a fair amount of refactoring that includes breaking some cookbooks out of our monolithic chef repo into individual ones. As part of that process, I introduced some testing infrastructure to go along with the new code. In some cases, we only needed to use ChefSpec. In others, test-kitchen was needed to flesh out the testing story.
While the test-kitchen documentation is good enough to get you started, for some non-trivial cases, it’s not sufficient, and the information needed is buried in github issues, on the Chef site itself, or just on random blogs (hey!