If you'd like to run the test suite, fix a bug or add a feature, please follow these steps:
-
Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
-
Check out the latest
masterbranch to make sure the feature hasn't been implemented or the bug hasn't been fixed -
Fork the project
-
Install all dependencies:
bundle install -
Start a feature/bugfix branch:
git checkout -b my_feature_name -
Place a
.envfile in the root of the project withAPI_KEYandAPPLICATION_KEY:API_KEY: myapikey APPLICATION_KEY: chefhandlerspecificapplicationkeyThis file is intentionally .gitignored to prevent security exposure. You may use your own Datadog account keys, as the keys are filtered from the test recordings. Running the test suite will not make calls to Datadog for existing tests, see
spec/support/cassettes/for more. -
Run
raketo execute tests, ensure they pass -
To test with a specific Chef version, use:
CHEF_VERSION=18.0 bundle install && bundle exec rspec -
To test with all supported Chef versions using Appraisal:
- Generate appraisal gemfiles:
bundle exec appraisal generate - Install dependencies:
bundle exec appraisal install - Run tests for all versions:
bundle exec appraisal rspec - Run tests for a specific version:
bundle exec appraisal chef-18 rspec
- Generate appraisal gemfiles:
-
Commit and push until you are happy with your contribution
-
Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
-
Please try not to mess with the
Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Sometimes you need to test chef-handler-datadog before a fix is merged. In this case you need to:
- Set the version in
lib/chef_handler_datadog.rbIf the current version is0.11.0then you should bump to0.11.1.pre. This way when the next version is released it will take precedence over your snapshot. - Run
rake build, this will create the .gem file in thepkg/dir - Copy the .gem file to your own gem server
- When you include
datadog::dd-handlerin your Chef runlist setnode.override['datadog']['gem_server']to your gem server URL andnode.override['datadog']['chef_handler_version']to your.preversion. - Chef will install your version of the gem
- Don't forget to unset
gem_serverandchef_handler_versiononce the handler has been released with your changes