Undefined local variable or Method - Testing Puppet Modules using Beaker

后端 未结 1 1021
天命终不由人
天命终不由人 2021-01-24 18:09

I\'m quite new to all of this. I am trying to test out a puppet module using Beaker. I keep getting this:

 NoMethodError: undefined method `describe\' for 
 #Bea         


        
1条回答
  •  时光取名叫无心
    2021-01-24 18:32

    You're mixing up unit- and VM-based testing.

    • rspec-puppet (and rspec-puppet-facts' on_supported_os) are for catalog-based unit testing. They do not require a VM, and can give you quick feedback on syntax, and logic of your module.

    • beaker, and the recommended beaker-rspec add-on, provide full end-to-end testing capabilities, using actual VMs, and testing a complete stack deploy (as defined in you tests).

    The main entry point for existing modules is usually rake. Take a look at the existing rake tasks in the module using rake -T. In a well-written module it should have tasks for both rspec-puppet (usually called spec), and beaker (often called beaker, or acceptance).

    If it is your own module, you also might want to look into the new Puppet Development Kit to get the most important tools in a single installer.

    0 讨论(0)
提交回复
热议问题