Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Latest commit

 

History

History
39 lines (19 loc) · 1.61 KB

TESTING.md

File metadata and controls

39 lines (19 loc) · 1.61 KB

Testing the camunda-template cookbook

This cookbook includes both unit tests via ChefSpec and integration tests via Test Kitchen. Contributions to this cookbook will only be accepted if all tests pass successfully:

kitchen test
rspec

Setting up the test environment

To test the camunda-template cookbook environment see VAGRANT for necessary installations

Clone the latest version of the cookbook from the repository.

git clone [email protected]:camunda-ci/camunda-template-cookbook.git
cd camunda-template-cookbook

Install the gems used for testing:

bundle install

Running ChefSpec

ChefSpec unit tests are located in test/unit. Each recipe has a recipename_spec.rb file that contains unit tests for that recipe. Your new functionality or bug fix should have corresponding test coverage - if it's a change, make sure it doesn't introduce a regression (existing tests should pass). If it's a change or introduction of new functionality, add new tests as appropriate.

To run ChefSpec for the whole cookbook:

rspec

To run ChefSpec for a specific recipe:

rspec spec/default_spec.rb

Running Test Kitchen

Test Kitchen test suites are defined in .kitchen.yml. Running kitchen test will cause Test Kitchen to spin up each platform VM in turn, running the camunda-template::default recipe. If the Chef run completes successfully, corresponding tests in test/integration are executed. These must also pass.