0

I am using kitchen to run inspec tests for the puppet repository. I am able to apply the entire puppet catalogue ina vagrant box and then run tests for it. But what if I want to run a specific module in the puppet code base alone? I don't want to apply the entire catalogue every single time.

Can kitchen apply specific modules instead of the entire catalogue? And then test for those modules as well?

Something like how in rspec I can specify a test case I want to run.

kitchen converge --path-to-file
kitchen verify --path-to-test-file
leoOrion
  • 1,833
  • 2
  • 26
  • 52
  • You can filter which modules are applied by `puppet agent` or `puppet apply` via [their `--tags` option](https://puppet.com/docs/puppet/5.5/lang_tags.html#using-tags). Although you can assign your own tags, classes and resources get automatic tags that may serve your purpose. In particular, you should try using the names of the modules you want applied as the tags. – John Bollinger Aug 10 '18 at 13:52
  • If you configure test-kitchen for a specific module instead of the entire catalog then it will do this by default. – Matthew Schuchard Aug 10 '18 at 14:39
  • @MattSchuchard I understand that changing the config can let me achieve this. I was hoping for some kind of override from the command line where I can specify the modules that I want to be applied. – leoOrion Aug 11 '18 at 04:14
  • Maybe I can try templatizing the kitchen yaml itself to accept the modules from outside. I can then use @JohnBollinger 's idea to create a puppet command with the appropriate tags and feed it to the yaml. I will try this out. – leoOrion Aug 11 '18 at 04:22

0 Answers0