1 # Contributing to the OpenDaylight Puppet Module
3 We work to make contributing easy. Please let us know if you spot something
8 1. [Overview](#overview)
9 2. [Communication](#communication)
13 3. [Patches](#patches)
14 4. [Testing](#testing)
15 - [Test Dependencies](#test-dependencies)
16 - [Coala Linting](#coala-linting)
17 - [Syntax and Style Tests](#syntax-and-style-tests)
18 - [Unit Tests](#unit-tests)
19 - [System Tests](#system-tests)
20 - [Tests in Continuous Integration](#tests-in-continuous-integration)
24 This is an offical upstream OpenDaylight codebase under the
25 [Integration/Packaging project][1].
27 We use [Trello][2] to track TODOs and [Gerrit][3] to submit changes. Email
28 the [integration-dev mailing list][4] to get in touch.
34 Enhancements, bugs and such are tracked on [Trello][2]. The Trello board is
35 shared with other Integration projects and related efforts. Puppet-opendaylight
36 is under the scope of the Integration/Packaging project, which has a column
37 and [tag][5] to collect its cards. Cards related to puppet-opendaylight will
38 typically mention it by name in the title.
42 Please use the [integration-dev][4] mailing list to contact puppet-opendaylight
43 developers. Please don't reach out to developers directly, per open source best
48 To chat synchronously with developers, join the **#opendaylight-integration**
49 on `chat.freenode.net`. If you're not familar with IRC, there are [web
50 clients][6] that can make getting started easy.
54 Please use [Gerrit][3] to submit patches. See the [ODL Gerrit docs][7]
55 general getting-started help.
57 Other tips for submitting excellent patches:
59 - Please provide test coverage for your changes.
60 - If applicable, please provide documentation updates to reflect your changes.
66 A Vagrant environment is provided to help manage test dependencies. All
67 software prerequisites and configuration for running all types of tests
68 should be handled automatically.
70 To provision and connect to a Fedora-based VM with test tools installed:
75 # cd to ~/puppet-opendaylight and hack away
78 A CentOS-based VM is also provided.
82 We use Coala (manged by tox) to run various linters, like spacing, line
83 length, Markdown, YAML, JSON, etc.
89 ### Syntax and Style Tests
91 We use [Puppet Lint][8], [Puppet Syntax][9] and [metadata-json-lint][10] to
92 validate the module's syntax and style.
95 $ bundle exec rake lint
96 $ bundle exec rake syntax
97 $ bundle exec rake metadata_lint
102 We use rspec-puppet to provide unit test coverage.
104 To run the unit tests and generate a coverage report, use:
107 $ bundle exec rake spec
110 To run the syntax, style and unit tests in one rake task (recommended), use:
113 $ bundle exec rake test
118 While the [unit tests](#unit-tests) are able to quickly find many errors,
119 they don't do much more than checking that the code compiles to a given state.
120 To verify that the Puppet module behaves as desired once applied to a real,
121 running system, we use [Beaker][11].
123 Beaker stands up virtual machines or containers using Vagrant or Docker,
124 applies the OpenDaylight Puppet module with various combinations of params
125 and uses [Serverspec][12] to validate the resulting system state.
127 To run Beaker tests against CentOS 7 in a VM using the latest OpenDaylight
131 $ bundle exec rake cent_8test_cbs_vm
134 To do the same tests in a CentOS container:
137 $ bundle exec rake cent_8test_cbs_dock
140 To run VM or container-based tests for all OSs:
143 $ bundle exec rake acceptance_vm
144 $ bundle exec rake acceptance_dock
147 If you'd like to preserve the Beaker VM after a test run, perhaps for manual
148 inspection or a quicker follow-up test run, use the `BEAKER_destroy`
149 environment variable.
152 $ BEAKER_destroy=no bundle exec rake cent_8test_cbs_vm
155 You can then connect to the VM by navigating to the directory that contains
156 its Vagrantfile and using standard Vagrant commands.
159 $ cd .vagrant/beaker_vagrant_files/centos-7.yml/
161 Current machine states:
163 centos-7 running (virtualbox)
165 $ sudo systemctl is-active opendaylight
171 ### Tests in Continuous Integration
173 The OpenDaylight Puppet module uses OpenDaylight's Jenkins silo to run tests
174 in CI. Some tests are triggered when changes are proposed, others are triggered
175 periodically to validate things haven't broken underneath us. See the
176 [`puppet-*` tests][13] on the Jenkins web UI for a list of all tests.
178 [1]: https://wiki.opendaylight.org/view/Integration/Packaging "Integration/Packaging project wiki"
180 [2]: https://trello.com/b/ACYMpTVD/opendaylight-integration "Integration Tello board"
182 [3]: https://git.opendaylight.org/gerrit/#/q/project:integration/packaging/puppet-opendaylight "puppet-opendaylight Gerrit"
184 [4]: https://lists.opendaylight.org/mailman/listinfo/integration-dev "integration-dev mailing list"
186 [5]: https://trello.com/b/ACYMpTVD/opendaylight-integration?menu=filter&filter=label:Int%2FPack "Integration/Packaging Trello cards"
188 [6]: http://webchat.freenode.net/?channels=opendaylight-integration "opendaylight-integration IRC web client"
190 [7]: http://docs.opendaylight.org/en/latest/gerrit.html "OpenDaylight Gerrit docs"
192 [8]: http://puppet-lint.com/ "Puppet lint"
194 [9]: https://github.com/gds-operations/puppet-syntax "Puppet syntax"
196 [10]: https://github.com/puppet-community/metadata-json-lint "Metadata JSON lint"
198 [11]: https://github.com/puppetlabs/beaker "Beaker system tests"
200 [12]: http://serverspec.org/resource_types.html "Serverspec"
202 [13]: https://jenkins.opendaylight.org/releng/view/packaging/search/?q=puppet "Puppet CI jobs"