I want to integrate my ChefSpecs with Jenkins in a way that there is one Jenkins job that runs all specs of all cookbooks and prints one summary. Unfortunately that doesn't seem as easy as I have thought. Writing a simple Rakefile that creates a rspec rake task (like when testing standard Ruby specs) won't help because rspec expects a Berksfile in the directory from which it is called.
So there seem to be only two ways to test cookbook specs ...
- Creating a Jenkins job for each and every cookbook
- Iterating manually through the cookbooks in Jenkins and calling rspec in each cookbook I find. Which will not print a summary of all tests and seems stupid anyway for multiple other reasons.
What is the recommended way here? Do I need to create a seperate job for every cookbook or is there a better way? Especially in combination with Berkshelf?
I can see the advantages of having a job for every cookbook's spec but that also means doing a git pull for dozens of cookbooks from the same repo. We currently use the "all cookbooks in one repo"-approach
Cheers, Stefan