Chef-NYC June-2014 - Testing cookbooks on Digital Ocean

1,380 views

Published on

Testing cookbooks on Digital Ocean with Test Kitchen, Serverspec, and ChefSpec

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,380
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
12
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Chef-NYC June-2014 - Testing cookbooks on Digital Ocean

  1. 1. Cookbook Testing with TravisCI, Test Kitchen and Digital Ocean
  2. 2. Sean OMeara! someara@getchef.com! @someara
  3. 3. whoami
  4. 4. Writing Cookbooks
  5. 5. Are we done?
  6. 6. Testing Cookbooks
  7. 7. Slightly more involved.
  8. 8. The Basics http://www.flickr.com/photos/jronaldlee/5295169486/
  9. 9. Run the recipe See what happens
  10. 10. Manual techniques Automated techniques
  11. 11. CLI IS BETTER
  12. 12. Converge Testing
  13. 13. Integration Testing ttps://www.flickr.com/photos/kitsa_sakurako/439652830
  14. 14. Test that a set of resources has achieved their combined goal
  15. 15. {testable intent
  16. 16. Test Kitchen runs integration tests out of band of Chef
  17. 17. It does this with bussers
  18. 18. Bats! Serverspec! Minitest! Cucumber
  19. 19. suite busser
  20. 20. kitchen test! ! kitchen converge! run integration tests! kitchen destroy
  21. 21. test tear down
  22. 22. Style Testing
  23. 23. Ruby level style enforcement
  24. 24. single quotes space after comma no trailing whitespace
  25. 25. Chef level style enforcement
  26. 26. http://www.flickr.com/photos/40389360@N00/2428706650/ Regression Testing
  27. 27. ChefSpec makes assertions about compiled resource collections
  28. 28. REFERENCE SLIDE
  29. 29. https://github.com/opscode-cookbooks/yum https://github.com/opscode-cookbooks/mysql Reference Cookbooks https://github.com/opscode-cookbooks/jenkins https://github.com/opscode-cookbooks/yum-epel
  30. 30. Cookbook Dependencies
  31. 31. Often, a cookbook will depend on another
  32. 32. include_recipe ‘another_cookbook::recipe’! ! OR! ! consume a resource shipped in another_cookbook
  33. 33. For example
  34. 34. not in core Chef
  35. 35. ships in mysql cookbook
  36. 36. Dependencies suck and you don’t want to manage them manually.
  37. 37. Berkshelf is bundler for Chef cookbooks
  38. 38. your chef-server here
  39. 39. Bundler installs dependencies into your local gem cache
  40. 40. Berkshelf installs dependencies into your local cookbook cache
  41. 41. needs moar ServerSpec
  42. 42. Travis CI
  43. 43. Because I like to close my laptop sometimes
  44. 44. I ran out of slides.

×