Added custom ODL repo, install ODL package
[integration/packaging/puppet-opendaylight.git] / CONTRIBUTING.md
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.
4
5
6 ## Contributing
7
8 1. Fork the repo.
9
10 2. Run the tests. We only take pull requests with passing tests, and
11    it's great to know that you have a clean slate
12
13 3. Add a test for your change. Only refactoring and documentation
14    changes require no new tests. If you are adding functionality
15    or fixing a bug, please add a test.
16
17 4. Make the test pass.
18
19 5. Push to your fork and submit a pull request.
20
21
22 ## Dependencies
23
24 The testing and development tools have a bunch of dependencies,
25 all managed by [bundler](http://bundler.io/) according to the
26 [Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions).
27
28 By default the tests use a baseline version of Puppet.
29
30 If you have Ruby 2.x or want a specific version of Puppet,
31 you must set an environment variable such as:
32
33     export PUPPET_VERSION="~> 3.2.0"
34
35 Install the dependencies like so...
36
37     bundle install
38
39 ## Syntax and style
40
41 The test suite will run [Puppet Lint](http://puppet-lint.com/) and
42 [Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
43 check various syntax and style things. You can run these locally with:
44
45     bundle exec rake lint
46     bundle exec rake syntax
47
48 ## Running the unit tests
49
50 The unit test suite covers most of the code, as mentioned above please
51 add tests if you're adding new functionality. If you've not used
52 [rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
53 about how best to test your new feature. Running the test suite is done
54 with:
55
56     bundle exec rake spec
57
58 Note also you can run the syntax, style and unit tests in one go with:
59
60     bundle exec rake test
61
62 ### Automatically run the tests
63
64 During development of your puppet module you might want to run your unit
65 tests a couple of times. You can use the following command to automate
66 running the unit tests on every change made in the manifests folder.
67
68     bundle exec guard
69
70 ## Integration tests
71
72 The unit tests just check the code runs, not that it does exactly what
73 we want on a real machine. For that we're using
74 [beaker](https://github.com/puppetlabs/beaker).
75
76 This fires up a new virtual machine (using vagrant) and runs a series of
77 simple tests against it after applying the module. You can run this
78 with:
79
80     bundle exec rake acceptance
81
82 This will run the tests on an Ubuntu 12.04 virtual machine. You can also
83 run the integration tests against Centos 6.5 with.
84
85     RS_SET=centos-64-x64 bundle exec rake acceptance
86
87 If you don't want to have to recreate the virtual machine every time you
88 can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
89 at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
90 for the created virtual machines will be in `.vagrant/beaker_vagrant_files`.
91