At Cotap, we have been integrating test-kitchen as part of our workflow to continuously test our infrastructure.

When combined with chef-zero, one very useful but hidden feature of test-kitchen is the ability to search for nodes.

To do so, you simply have to drop files in your ‘test/integration/nodes’ folder. Each JSON file will then be a representation of a node in your environment.

How does it work?

The first thing to do is to make sure you are using the chef-zero provisioner in your .kitchen.yml.

Then add a statsd host to your environment by writing to 'test/integration/nodes/statsd.json’.

You can now search for the statsd instance inside of a recipe: