diff --git a/cookbooks/cwb-server/.delivery/project.toml b/cookbooks/cwb-server/.delivery/project.toml new file mode 100644 index 0000000..039fc8a --- /dev/null +++ b/cookbooks/cwb-server/.delivery/project.toml @@ -0,0 +1,8 @@ +[local_phases] +unit = "chef exec rspec spec/" +lint = "chef exec cookstyle" +syntax = "chef exec foodcritic . --exclude spec -f any # -t \"~FC064\" -t \"~FC065\"" +provision = "chef exec kitchen create" +deploy = "chef exec kitchen converge" +smoke = "chef exec kitchen verify" +cleanup = "chef exec kitchen destroy" diff --git a/cookbooks/cwb-server/DEVELOPMENT.md b/cookbooks/cwb-server/DEVELOPMENT.md index e597ec6..a9db604 100644 --- a/cookbooks/cwb-server/DEVELOPMENT.md +++ b/cookbooks/cwb-server/DEVELOPMENT.md @@ -16,8 +16,29 @@ make install make outdated # Run integration tests make test -# Run linter -make lint +# Run all tests +make all_tests +# Run syntax checker +make syntax +``` + +## Testing + +This cookbook uses (Chef Delivery Local)[https://docs.chef.io/delivery_cli.html#delivery-local] to automate testing stages. + +Run all tests: + +```bash +delivery local all +``` + +Individual phases: + +```bash +delivery local lint # Cookstyle (Rubocup-based Ruby style linter) +delivery local syntax # Foodcritic (cookbook checker) +delivery local unit # short-running unit tests (rspec + chefspec) +delivery local functional # long-running integration tests ``` ## Debugging Vagrantfile diff --git a/cookbooks/cwb-server/Makefile b/cookbooks/cwb-server/Makefile index 3e604d8..2baf85f 100644 --- a/cookbooks/cwb-server/Makefile +++ b/cookbooks/cwb-server/Makefile @@ -13,10 +13,13 @@ integration_test: kitchen test unit_test: - chef exec rspec + delivery local unit lint: - foodcritic . + delivery local lint + +syntax: + delivery local syntax vendor: install ./vendor_berks_cookbooks.sh diff --git a/cookbooks/cwb-server/graph.png b/cookbooks/cwb-server/graph.png index b99bc4e..8129745 100644 Binary files a/cookbooks/cwb-server/graph.png and b/cookbooks/cwb-server/graph.png differ