1 This module has grown over time based on a range of contributions from
2 people using it. If you follow these contributing guidelines your patch
3 will likely make it into a release a little quicker.
8 Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [Contributor Code of Conduct](https://voxpupuli.org/coc/).
12 1. Create a separate branch for your change.
14 1. Run the tests. We only take pull requests with passing tests, and
17 1. Add a test for your change. Only refactoring and documentation
18 changes require no new tests. If you are adding functionality
19 or fixing a bug, please add a test.
21 1. Squash your commits down into logical components. Make sure to rebase
22 against the current master.
24 1. Push the branch to your fork and submit a pull request.
26 Please be prepared to repeat some of these steps as our contributors review
31 The testing and development tools have a bunch of dependencies,
32 all managed by [bundler](http://bundler.io/) according to the
33 [Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions).
35 By default the tests use a baseline version of Puppet.
37 If you have Ruby 2.x or want a specific version of Puppet,
38 you must set an environment variable such as:
40 export PUPPET_VERSION="~> 4.2.0"
42 Install the dependencies like so...
48 The test suite will run [Puppet Lint](http://puppet-lint.com/) and
49 [Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
50 check various syntax and style things. You can run these locally with:
53 bundle exec rake validate
55 ## Running the unit tests
57 The unit test suite covers most of the code, as mentioned above please
58 add tests if you're adding new functionality. If you've not used
59 [rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
60 about how best to test your new feature.
62 To run all the unit tests
64 bundle exec rake spec SPEC_OPTS='--format documentation'
66 To run a specific spec test set the `SPEC` variable:
68 bundle exec rake spec SPEC=spec/foo_spec.rb
70 To run the linter, the syntax checker and the unit tests:
77 The unit tests just check the code runs, not that it does exactly what
78 we want on a real machine. For that we're using
79 [beaker](https://github.com/puppetlabs/beaker).
81 This fires up a new virtual machine (using vagrant) and runs a series of
82 simple tests against it after applying the module. You can run this
85 bundle exec rake acceptance
87 This will run the tests on an Ubuntu 12.04 virtual machine. You can also
88 run the integration tests against Centos 6.5 with.
90 BEAKER_set=centos-64-x64 bundle exec rake acceptances
92 If you don't want to have to recreate the virtual machine every time you
93 can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
94 at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
95 for the created virtual machines will be in `.vagrant/beaker_vagrant_files`.
97 # vim: syntax=markdown