Validating and testing modules
Puppet Development Kit (PDK) provides tools to help you run unit tests on your module and validate your module's metadata, syntax, and style.
By default, the PDK module template includes tools that can:
-
Validate the
metadata.json
file. -
Validate Puppet syntax.
-
Validate Puppet code style.
-
Validate Ruby code style.
-
Run unit tests.
To ensure that your module works with Puppet, validate and unit test your modules against specific versions of Puppet and Puppet Enterprise (PE). This allows you to find and fix module issues before you upgrade.
With command line options, you can specify major or minor versions, such as Puppet 5 or PE 2017.3.2. When you specify a major version, PDK tests against the most recent available release of the major version. PDK reports which PE or Puppet version it is running checks against. For usage instructions and examples, see the unit testing and validation topics below.
You can validate or test against any version of Puppet or PE that is currently under maintenance. See Puppet and Puppet Enterprise lifecycle pages for details.
In this section: