Environment-based testing

The environment-based testing workflow lets you test new code before pushing it to production.

Setting up environment-based testing requires a specific node group hierarchy. Before setting up environment-based testing, make sure you understand Environment versus classification node groups and how to Create node groups.

The basic node group hierarchy for environment-based testing is as follows:

  1. All Nodes (root node group of all node groups)
    1. All Environments (parent of all environment node groups)
      1. Production environment node group
      2. Staging environment node group
      3. Test environment node group
      4. Development environment
    2. PE Infrastructure node group
    3. Classification node groups and their children (Child groups can be used to Test and promote a parameter or Test and promote a class)

The following screenshot and table explain the environment-based testing node-group hierarchy components:

A node group hierarchy for environment-based testing. Six call-out labels
 indicate various groups and their functions.

Call-out label Group name or category Description
1 All Nodes Root node group of all node groups. Its direct children are the All Environments node group, the PE Infrastructure node group, and the top-level classification node groups.
2 All Environments Each environment node group must be a child of this group. The Puppet environment assigned to this group is the default Puppet environment used for nodes without an assigned or matched default environment.
If this group doesn't exist, create it.
3 Various environment node groups, each being direct children of All Environments Environment node groups specify the Puppet environment that your nodes belong to. Nodes can belong to only one environment node group, which determines the node's default environment.
4 Optional one-time run exception group, which is a direct child of a specific environment node group Used to Test code with canary nodes and alternate Puppet environments. This group acts as a gatekeeper, and, when present, permits nodes in the parent environment node group to temporarily use Puppet environments other than their normal default environment.

This is the only condition where it is possible for an environment node group to have a child group.

5 PE Infrastructure node group (and its child groups) These are built-in classification node groups used to manage infrastructure nodes. Don't modify these groups except when following official documentation or support instructions.
6 Various classification node groups and their children Classification node groups apply classes and configuration data to nodes. Nodes can belong to multiple classification node groups. Child classification node groups can be used Test and promote a parameter or Test and promote a class.