Patrick Debois, the godfather of DevOps, recently posted an article called Puppet unit testing like a pro. This article spawned some discussion about cucumber-puppet usage and how to get started. As I wanted to develop some ideas about this anyways, I setup an example project on github. You can follow the commit history to see how the project evolved and how I currently think cucumber-puppet should be used:
- On a global scale, use a catalog policy to ensure all your node catalogs obey the same basic rules.
- Use module specific features to specify behaviour in manifests, templates, custom functions, etc.
- Don’t repeat your manifests in your features, however. There’s no value in it.
This exercise verified my thoughts on some technical aspects of cucumber-puppet. The goal of this project should not be to provide step definitions for all kinds of scenarios, but instead provide basic helper methods that empower people to implement the steps they actually need. I want you to implement step definitions on your own, however, you shouldn’t have to dig through the puppet source to do so.
This was a great learning experience for me.
What do you think, is this going in a sensible direction? Are there any specific things you would like to see in the example project? Let me know in the comments!