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

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)
主站蜘蛛池模板: 曲沃县| 抚顺县| 永春县| 喀喇| 昔阳县| 屏东县| 丹寨县| 曲靖市| 当涂县| 安龙县| 榆社县| 阳信县| 廊坊市| 漳浦县| 祁连县| 永丰县| 普安县| 安图县| 长武县| 深泽县| 江油市| 星座| 台前县| 深圳市| 固镇县| 招远市| 博白县| 房山区| 任丘市| 武安市| 石景山区| 会昌县| 莱州市| 桐乡市| 厦门市| 安吉县| 和硕县| 忻州市| 绥江县| 建瓯市| 娱乐|