On 3/18/15 10:02 PM, Johan De Wit wrote:
> Hi all,
> 
> Looking for some best practice, guideline, documentation puppet testing
> in all its aspect, sometimes I try to figure out the following :
> 
> How does one tests roles and profiles ?
> 
> Do we still write rspec-puppet for profiles ?  Since we are using
> modules that have there own unit (rspec) testing, at first sight, this
> looks like overhead.
> 
> what about the profiles we make using other profiles ?  Do we unit-test 
> our 'base' profiles only ?
> 
> Or does one only do integration testing (aka beaker ...) for the
> roles/nodes level only, and doing no (unit ?) testing on the profiles ?
> 
> 
> I hope to just trigger a discussion on this topic that will bring me one
> step closer to my own Test Driven Infrastructure.
> 
> Grts
> 
> Johan
> 

Hi Johan,

Good timing, I just gave a talk[1] about this subject last week at
Cascadia IT Conference in Seattle. Slide 41 starts talking about this.

Using tools like beaker and serverspec are great for testing individual
modules. A role is composed of many classes. A quick look at a simple
role I have for a yum repo server has 36 classes in 23 modules.

Monitoring is how we all test if production is working. Before deploying
new code, suggest creating a representative system for each role that
you manage and using your monitoring to ensure that it is working
correctly. Tools like serverspec generally test locally on the system
with tests such as is a port listening? is the service running?

We want to test a system from the point of view of the consumer. In the
example of the yum repo, you would want to have a separate system
attempt to install a package served from that host. This approach also
creates a nice loop between deployments and monitoring so that your
monitoring (aka testing) of the services will improve.

[1] -
http://www.slideshare.net/gh/functional-testing-for-configuration-management-20150314-cascadia-it-conference/41

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/550A7BF6.2060800%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to