官术网_书友最值得收藏!

Chapter 5. Testing Your Recipes

So far, you have seen how to model your infrastructure, provision hosts in the cloud, and what goes into a cookbook. One important aspect of developing cookbooks is writing tests so that your recipes do not degrade over time or have bugs introduced into them in the future. This chapter introduces you to the following concepts:

  • Understanding test methodologies
  • How RSpec structures your tests
  • Using ChefSpec to test recipes
  • Running your tests
  • Writing tests that cover multiple platforms

These techniques will prove to be very useful to write robust, maintainable cookbooks that you can use to confidently manage your infrastructure. Tests enable you to perform the following:

  • Identify mistakes in your recipe logic
  • Test your recipes against multiple platforms locally
  • Develop recipes faster with local test execution before running them on a host
  • Catch the changes in dependencies that will otherwise break your infrastructure before they get deployed
  • Write tests for bugs to prevent them from happening again in the future (regression)
主站蜘蛛池模板: 台山市| 罗城| 开封县| 扬中市| 汝阳县| 普陀区| 巴林右旗| 五河县| 临桂县| 泸定县| 合山市| 辽阳市| 洪泽县| 民县| 连城县| 临夏市| 栾川县| 孝义市| 来安县| 双柏县| 买车| 吕梁市| 锡林郭勒盟| 渝中区| 托克逊县| 丹寨县| 呈贡县| 明溪县| 赣州市| 当涂县| 石家庄市| 高邑县| 汤阴县| 阿城市| 彰武县| 德钦县| 辉南县| 河西区| 长沙市| 中阳县| 韶山市|