- Always been in Ops or Support
- Until recently, I have never really worked closely with developers
- I have been doing Puppet since 2008 (v 0.24.7)
- First looked at testing Puppet modules about a year ago
- Why Testing
- What is Testing
- What to Test
- Next Steps
What I Thought?
- Help catch mistakes
- Test that things work
Why Didn't I Start Writing Tests Regularly?
- I was basically reimplementing my manifests in rspec
- No guidance on what to test and why to test
- Wait a sec, you mean it doesn't actually test if it works?
- Didn't understand the types of tests
So Then Why Are We Here?
- Testing configuration beyond just the manifests
- Manifests are getting more complicated
- Knowing that integration testing is coming
- Makes writing Puppet code more fun
Types of Tests
- Syntax Checking
- Unit Tests
- Integration Tests
- Something a lot of us have done for a while
- Important, but doesn't do much
- puppet-lint and food critic
- Makes reading manifests and code easier
- Reminds you to do things like documentation
- Multiple tools in Chef
- Test the code returns the things that are expected
- In Puppet, testing the catalog
- Get syntax checking for free
- Does the catalog actually apply or the run converge?
- Did it actually work?
It Is Driving Development, Right?
- Before you start writing config mgmt code
- After you found a problem in dev/prod
- As you go
- Are the packages getting marked for install?
- Is the config file getting put in the right place for this platform?
- Is the service being started?
Important Config Elements
- Is the Include directive in the apache config?
- How about that Rewrite rule?
- Are the search domains in the right order?
- Are we setting the right options for SOLR?
- Is logging enabled?
- Are we disabling display_errors in PHP?
- Is caching on in prod but off in dev?
- Is debug on in dev but off in prod?
Show me on the doll where the config touched you...
- A place to document those silly config changes and test them
- Make sure the same mistake doesn't happen twice
- Automation via Continuous Integration
- Integration testing (Test Kitchen)
- Nagios/Monitoring Integration