Over a million developers have joined DZone.

Recommended Tools for Testing Puppet Code

· DevOps Zone

The DevOps zone is brought to you in partnership with Sonatype Nexus. The Nexus suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

Since modifying Puppet manifiests, a lot of errors can... manifest :)   
So Puppet Labs was kind enough to put together a small post on verifying your Puppet manifests for infrastructure automation with a nice list and description of a few syntax checking and automated testing songs.  You should follow the source link below to see the whole post, but I'm just going to take the 'TL;DR version' route here and give you the list of tools they provided:

Syntax Checks


Manually run 'puppet parser validate selinux.pp' - ensures that your manifest can be parsed before you commit your changes
Vim's built in code compilation - can be used to run error checking
Syntastic - continuously checks and alerts for syntax errors
puppet-lint - this was developed by GitHub’s Tim Sharpe.  It analyzes your manifests and looks for deviations from the Puppet style guide

Automated Module Testing


rspec and Cucumber -  their tests to ensure that your modules are creating the resources that you expect
puppet-apt module - Puppet module to help manage the Advanced Package Tool
Puppet Forge - for verifying modules if they have tests

Automated System Testing

Cucumber - A Ruby-based BDD framework that can be used to ensure that you get the correct
Puppet host that you asked for

For a deeper tutorial, you really ought to read Patrick Dubois' Puppet Testing like a Pro

The DevOps zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}