I have a few questions in regards to the testing approach for Chef cookbooks.
In my opinion, I think my ultimate goal of having a unit test for Chef cookbook is to test and validate the cookbook before syncing that to the Chef server via Azure DevOps (CI/CD) pipeline. Since I’m having some ChefSpec tests right now, would it be the best approach to integrate ChefSpec tests into the pipeline by adding a PowerShell step to run all the tests before publishing the cookbook in the pipeline?
- Should I consider something else like InSpec (since there is a dedicated step in the pipeline for InSpec)?
- But generally what is the biggest differences between ChefSpec and InSpec in term of unit testing for Chef cookbook?
At the moment, I’m running
‘’’chef exec rspec’’’
To run all the tests located under spec folder inside my cookbook