Jump to: navigation, search

Difference between revisions of "Puppet/Unit testing"

(Created page with "== Rspec puppet tests == Rspec puppet tests are a requirement for getting code merged into the OpenStack puppet modules. The best reference for getting started with rspec-pu...")
 
(retire page)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Rspec puppet tests ==
+
'''These docs are outdated, but kept here for historical reasons and search access. To view the latest docs, please refer to http://docs.openstack.org/developer/puppet-openstack-guide/'''
  
Rspec puppet tests are a requirement for getting code merged into the OpenStack puppet modules.
+
<strike>
 
+
The best reference for getting started with rspec-puppet can be found [http://rspec-puppet.com/ here].
The best reference for getting started with rspec-puppet can be found [http://rspec-puppet.com/ here]
 
 
 
For a new puppet openstack project, please see this [[Puppet-openstack/Development|page]]
 
  
 
== Running local tests ==
 
== Running local tests ==
 
 
The following command can invoked from any if the  modules' directories to run their rspec puppet tests.
 
The following command can invoked from any if the  modules' directories to run their rspec puppet tests.
 
 
It assumes that both bundler as well as rubygems (and ruby) are already installed on the system.
 
It assumes that both bundler as well as rubygems (and ruby) are already installed on the system.
  
Line 16: Line 11:
 
  export GEM_HOME=vendor
 
  export GEM_HOME=vendor
 
  bundle install
 
  bundle install
# bundle exec rake -T
 
 
  bundle exec rake spec
 
  bundle exec rake spec
  
 
This relies on the file .fixtures.yaml to install all of the external module required for testing.
 
This relies on the file .fixtures.yaml to install all of the external module required for testing.
 
The urls in this file use the git:// protocol, so this may need to be updated if you are behind a proxy.
 
The urls in this file use the git:// protocol, so this may need to be updated if you are behind a proxy.
 +
</strike>

Latest revision as of 23:29, 18 May 2016

These docs are outdated, but kept here for historical reasons and search access. To view the latest docs, please refer to http://docs.openstack.org/developer/puppet-openstack-guide/

The best reference for getting started with rspec-puppet can be found here.

Running local tests

The following command can invoked from any if the modules' directories to run their rspec puppet tests. It assumes that both bundler as well as rubygems (and ruby) are already installed on the system.

mkdir vendor
export GEM_HOME=vendor
bundle install
bundle exec rake spec

This relies on the file .fixtures.yaml to install all of the external module required for testing. The urls in this file use the git:// protocol, so this may need to be updated if you are behind a proxy.