4. Deployment testing
● Start VM on Vagrant/AWS ~ 1-3 minutes
● Install chef client ~ 1 minute
● Wait for deployment ~ 10 - ∞ minutes
● Check configuration ~ 5 - 30 minutes
5. Unacceptable!
● About 20 minutes
● Manual testing
● No info about
current code status
6. CI/CD for deployment automation
● Unit test for every recipe
● Integration tests for every service
● Automated on-commit builds
● Email notifications
● Release to file storage or Chef Server
7. Kitchen set for the better chef
● ChefSpec - unit testing for every recipe
● Serverspec - integration testing for server
configurations
● Foodcritic - static code validation
● Docker - fast start/destroy containers
8. Foodcritic - verify ingredients
● Tests 45 most common
mistakes
● Checks template and
variables
● Integrates with Jenkins
9. ChefSpec - check recipe
● Test your recipes in RSpec style
● DSL with tons of manuals
10. Serverspec - deployment taste
● RSpec syntax again
● SSH or local exec
● Basic Windows
support
12. Development workflow
CI Server
Git repository
new commit
fb-static-tests
Foodcritic
ChefSpec
fb-integration-tests
Serverspec
Artifact
Build report
On-commit code validation
13. Shut up and setup my CI!
● Start writing tests!
● Use dependency
manager
● Setup CI server
● Create centralized
release binary repo
14. TDD for Chef
http://www.amazon.com/Test-Driven-Infrastructure-Chef-
Behavior-Driven-Development/dp/1449372201