module-postgresql/spec/system
Ken Barber 2114333539 Add locale parameter support
This adds the parameter 'locale' to the 'postgresql' class so we have a global
default, and adds it two the defined resources 'postgresql::db' and
'postgresql::database'. This allows users to either:

* Defined a global default for the cluster
* Define a per-database default

As a side-effect I had to make sure 'charset' was also exposed in a similar
manner as some locales need a particular charset to work.

Tests were added to test both the 'createdb' case and 'initdb' case for Redhat,
and some refactoring was done to make the existing non_default test area use
heredocs so my manifests and test code was kept close together. As apposed to
entirely different files and places in the directory structure.

I cleaned up the related execs a little bit, adding logoutput => on_failure
where needed so we can debug failures. Beforehand execs just 'failed', but
now we should be able to get better feedback from failed execs helping support.

I also add intention comments in parts of the Puppet code that I touched where
it made sense.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-02-05 17:23:52 +00:00
..
distros Add unit tests and travis-ci support 2013-02-05 15:15:03 +00:00
test_module/manifests/system_default Add locale parameter support 2013-02-05 17:23:52 +00:00
base.pp Add unit tests and travis-ci support 2013-02-05 15:15:03 +00:00
README.md Add unit tests and travis-ci support 2013-02-05 15:15:03 +00:00

Warning: these spec tests are pretty resource intensive!

You will need the following in order to run them:

If you just run:

rspec ./spec

then, for each distro that has a Vagrantfile in the spec/distros directory, vagrant will download a base image from the web, fire up a VM, and run the suite of tests against the VM.

If you only want to run the tests against an individual distro, you can instead do something like:

rspec ./spec/distros/ubuntu_lucid_64

For some options that might speed up the testing process a bit during development, please see spec/support/postgres_test_config.rb.

By default the sahara gem restores VMs to a snapshot state after each test, to make sure that the individual tests aren't polluting the ones that are run later. If you want to disable this during development, you can set HardCoreTesting to false in spec/support/postgres_test_config.rb.