Add building/connecting vagrant-odl docs in README
[integration/packaging/puppet-opendaylight.git] / CONTRIBUTING.markdown
index 41fd13786ee5220a7a21f105be9580cefa2a6590..6fa420edb11b01e7877ea4cf9cb9eeedb4fc35f8 100644 (file)
@@ -13,6 +13,7 @@ We work to make contributing easy. Please let us know if you spot something we c
     * [Syntax and Style Tests](#syntax-and-style-tests)
     * [Unit Tests](#unit-tests)
     * [System Tests](#system-tests)
+    * [Tests in Continuous Integration](#tests-in-continuous-integration)
 
 ## Overview
 
@@ -22,9 +23,9 @@ We accept patches via [GitHub Pull Requests](https://github.com/dfarrell07/puppe
 
 ## Communication
 
-Please use public, documented communication instead of reaching out to developers 1-1.
+*Please use public, documented communication instead of reaching out to developers 1-1.*
 
-Open Source projects benefit from always communicating in the open. Other people may run into the same issue, search for a similar trace and find your question, already answered. More eyes may even get your question answered faster.
+Open Source projects benefit from always communicating in the open. Previously answered questions end up becoming documentation for other people hitting similar issues. More eyes may get your question answered faster. Doing everything in the open keeps community members on an equal playing field (`@<respected company>` email addresses don't get priority, good questions do).
 
 We prefer [Issues](https://github.com/dfarrell07/puppet-opendaylight/issues) for most communication.
 
@@ -56,11 +57,11 @@ Basics of a pull request:
 * Use the GitHub web UI to fork our repo.
 * Clone your fork to your local system.
 * Make your changes.
-* Commit your changes, using a good commit message and referencing any applicable issues.
+* Commit your changes, using a [good commit message](http://chris.beams.io/posts/git-commit/) and referencing any applicable issues.
 * Push your commit.
 * Submit a pull request against the project, again using GitHub's web UI.
 * We'll give feedback and get your changed merged ASAP.
-* You contributed! Thank you!
+* You contributed! [Thank you](http://cdn3.volusion.com/74gtv.tjme9/v/vspfiles/photos/Delicious%20Dozen-1.jpg)!
 
 Other tips for submitting excellent pull requests:
 * If you'd like to make more than one logically distinct change, please submit them as different pull requests (if they don't depend on each other) or different commits in the same PR (if they do).
@@ -74,17 +75,18 @@ Other tips for submitting excellent pull requests:
 
 The testing tools have a number of dependencies. We use [Bundler](http://bundler.io/) to make installing them easy.
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ bundle install
 ```
 
 ### Syntax and Style Tests
 
-We use [Puppet Lint](http://puppet-lint.com/) and [Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to validate the module's syntax and style.
+We use [Puppet Lint](http://puppet-lint.com/), [Puppet Syntax](https://github.com/gds-operations/puppet-syntax) and [metadata-json-lint](https://github.com/puppet-community/metadata-json-lint) to validate the module's syntax and style.
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ bundle exec rake lint
 [~/puppet-opendaylight]$ bundle exec rake syntax
+[~/puppet-opendaylight]$ bundle exec rake metadata
 ```
 
 ### Unit Tests
@@ -93,7 +95,7 @@ We use rspec-puppet to provide unit test coverage.
 
 To run the unit tests and generate a coverage report, use:
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ bundle exec rake spec
 # Snip test output
 Finished in 10.08 seconds (files took 0.50776 seconds to load)
@@ -109,7 +111,7 @@ Note that we have a very large number of tests and 100% test coverage.
 
 To run the syntax, style and unit tests in one rake task (recommended), use:
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ bundle exec rake test
 ```
 
@@ -117,23 +119,23 @@ To run the syntax, style and unit tests in one rake task (recommended), use:
 
 While the [unit tests](#unit-tests) are able to quickly find many errors, they don't do much more than checking that the code compiles to a given state. To verify that the Puppet module behaves as desired once applied to a real, running system, we use [Beaker](https://github.com/puppetlabs/beaker).
 
-Beaker stands up virtual machines using Vagrant, applies the OpenDaylight puppet module with various combinations of params and uses [Serverspec](http://serverspec.org/resource_types.html) to validate the resulting system state.
+Beaker stands up virtual machines using Vagrant, applies the OpenDaylight Puppet module with various combinations of params and uses [Serverspec](http://serverspec.org/resource_types.html) to validate the resulting system state.
 
 To run our Beaker test against the primary target OS (CentOS 7) using the recommended RPM-based install method:
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ bundle exec rake beaker
 ```
 
 The `RS_SET` environment variable can be use to change Beaker's target OS (Fedora 20, Fedora 21, CentOS 7, Ubuntu 14.04). ODL's install method (RPM or tarball) can be configured via the `INSTALL_METHOD` environment variable.
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ RS_SET=fedora-20 INSTALL_METHOD=tarball bundle exec rake beaker
 ```
 
 There are a number of pre-defined rake tasks to simplify running common Beaker tests.
 
-```ShellSession
+```
 [~/puppet-opendaylight]$ bundle exec rake centos
 [~/puppet-opendaylight]$ bundle exec rake centos_tarball
 [~/puppet-opendaylight]$ bundle exec rake fedora_20
@@ -141,10 +143,30 @@ There are a number of pre-defined rake tasks to simplify running common Beaker t
 [~/puppet-opendaylight]$ bundle exec rake ubuntu
 ```
 
-If you'd like to preserve the Beaker VM after a test run, perhaps for manual inspection or a quicker follow-up test run, use the `BEAKER_DESTROY` environment variable.
+If you'd like to preserve the Beaker VM after a test run, perhaps for manual inspection or a quicker follow-up test run, use the `BEAKER_destroy` environment variable.
 
-```ShellSession
-[~/puppet-opendaylight]$ BEAKER_DESTROY=no bundle exec rake centos
+```
+[~/puppet-opendaylight]$ BEAKER_destroy=no bundle exec rake centos
+```
+
+You can then connect to the VM by navigating to the directory that contains its Vagrantfile and using standard Vagrant commands.
+
+
+```
+[~/puppet-opendaylight]$ cd .vagrant/beaker_vagrant_files/centos-7.yml
+[~/puppet-opendaylight/.vagrant/beaker_vagrant_files/centos-7.yml]$ vagrant status
+Current machine states:
+
+centos-7                  running (virtualbox)
+[~/puppet-opendaylight/.vagrant/beaker_vagrant_files/centos-7.yml]$ vagrant ssh
+[vagrant@centos-7 ~]$ sudo systemctl status opendaylight
+opendaylight.service - OpenDaylight SDN Controller
+   Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; enabled)
+   Active: active (running) since Fri 2015-04-24 16:34:07 UTC; 1min 1s ago
+     Docs: https://wiki.opendaylight.org/view/Main_Page
+           http://www.opendaylight.org/
+[vagrant@centos-7 ~]$ logout
+[~/puppet-opendaylight/.vagrant/beaker_vagrant_files/centos-7.yml]$ vagrant destroy -f
 ```
 
 For more information about using Beaker, see [these docs](https://github.com/puppetlabs/beaker/wiki/How-to-Write-a-Beaker-Test-for-a-Module#typical-workflow).