Josh Bavari's Thoughts

Thoughts on technology and philosophy

Puppet: A Testing Handbook

about a 1 minute read

  • Explain why the post – job required, growing pains, need for stability and health of the repo
  • Why to test
  • What to test
  • How to test Lint – Rake file Parser – rake file with globbing to run easier Rspec – spec type tests to run on puppet code (syntax mainly) Beaker – run tests on provisioned VM to ensure correct


puppet-lint puppet parser validate <manifest.pp> puppet-rspec – A gem that runs rspec unit tests on a module (Based on compiled catalog) Beaker

Part of my role at work is managing a fleet of robots, servers, and other infrastructure responsible for running our business. Due to the nature of our business, we run within customer warehouses.

Being a one man operation, one of my main concerns is keeping all the systems stable and proper working conditions. I am not the only developer touching our puppet code, but I’m the one responsible for the system(s).

As I embarked on the journey to add reliability to our infrastructure, something very clear came up: there’s a lot of information about testing puppet, but most of it is fractured, out of date, or hard to understand. See this slideshow from 2016 about the state of testing puppet.

I’m writing this post up to act as a handbook of sorts for testing puppet, as well as a ‘repository’ for testing puppet.

Testing resources