Note
Archived since I have learned what I planned to and no longer plan to commit new changes
Added for QAOps presentation
- Install chefDK from this link (these examples were implemented for chef 3.0.36 version)
- Install Vagrant from this link
- Install Virtualbox from this link
Steps that were run in order to get the mydatabase
chef generate cookbook mydatabase
.- [Alternative for tests #1] create mydatabase folder and run
kitchen init
there. - [Alternative for tests #2] create mydatabase folder and run
chef exec rspec init
there.
Unit tests run in memory without deploying recipe to VM
chef exec rspec
- quick runchef exec rspec --format documentation
- with details
Integration tests run against VM with deployed recipe.
cd mydatabase/
kitchen list
Expected: No errors
- [Optional]
kitchen converge
- redeploy cookbook after recipe changes to run kitchen correctly - [Optional]
kitchen login
- verify setup manually kitchen verify
- create VM, deploy cookbook and run inspec tests
inspec shell
help <resource_name>
(For example:help postgres_session
)