Re: [Puppet Users] Puppet 3.0 rspec and custom resources

Nathan Huff
Mon, 29 Oct 2012 18:13:05 -0000

OK so I have what I think is a minimal test case here:

https://github.com/nhuff/spec-failure

The readme has a list of gems I have installed in it.

You seem to need spec tests for two classes, one of which is in a sub
namespace of the other.
In this case ''test'' and ''test::c''.  With
both spec files in place the
system complains about anchor not being defined.
If you remove the test file for test::c the test for class test will pass.

On Monday, October 29, 2012 10:36:50 AM UTC-5, Nathan Huff
wrote:
>
> A super simple module that just has a file and anchor resources works fine
> so it isn''t that things aren''t getting loaded at all.  I
am going to start
> ripping things out of my more complex module and see if I can track down
> the trigger.
>
> On Friday, October 26, 2012 5:35:07 PM UTC-5, Jeff McCune wrote:
>>
>> Hrmmm.
>>
>> Is there a small rspec example you could post that reproduces this
>> issue?  I''d love to try and reproduce it since
there''s definitely a
>> possibility that a change between Puppet 2.7 and 3.0 is responsible
>> for this issue.
>>
>> -Jeff
>>
>> On Fri, Oct 26, 2012 at 8:01 AM, Nathan Huff
<nathan....@gmail.com>
>> wrote:
>> > I am trying to figure out if I am missing something simple here.
After
>> > upgrading to puppet 3.0 running puppet-rspec tests that use
>> > custom resources from modules in the fixtures directory are
failing.  I
>> have
>> > a module that uses the anchor type and with 2.7.19 it works fine.
>> > After upgrading to 3.0 all of the tests are failing with
>> >
>> > Puppet::Error:
>> >        Puppet::Parser::AST::Resource failed with error
ArgumentError:
>> > Invalid resource type anchor at
>> >
>>
/home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2
>> on
>> > node enyo.localhost
>> >
>> > The debug output is
>> > Debug: importing
>> >
''/home/nrhuff/repos/puppet-os/spec/fixtures/manifests/site.pp''
in
>> > environment production
>> > Debug: importing
>> >
>>
''/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/init.pp''
>>
>> > in environment production
>> > Debug: Automatically imported stdlib from stdlib into production
>> > Debug: importing
>> >
>>
''/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/stages.pp''
>>
>> > in environment production
>> > Debug: Automatically imported stdlib::stages from stdlib/stages
into
>> > production
>> > Debug: importing
>> >
>>
''/home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp''
>> in
>> > environment production
>> > Debug: Automatically imported os from os into production
>> > Error: Puppet::Parser::AST::Resource failed with error
ArgumentError:
>> > Invalid resource type anchor at
>> >
>>
/home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2
>> on
>> > node enyo.localhost
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource.rb:218:in
>>
>> > `initialize''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:120:in
>>
>> > `initialize''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
>>
>> > `new''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/util/errors.rb:35:in
>>
>> > `exceptwrap''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:43:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
>>
>> > `collect''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/module.rb:283:in
>>
>> > `collect''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:16:in
>>
>> > `each''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:15:in
>>
>> > `each''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
>>
>> > `collect''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>>
>> > `safeevaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:25:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>>
>> > `each''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>>
>> > `safeevaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource/type.rb:136:in
>>
>> > `evaluate_code''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:81:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb
>>
>> > :165:in `evaluate_classes''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:150:in
>>
>> > `each''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:150:in
>>
>> > `evaluate_classes''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/functions/include.rb:11:in
>>
>> > `real_function_include''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/functions.rb:63:in
>>
>> > `send''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/functions.rb:63:in
>>
>> > `function_include''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/function.rb:31:in
>>
>> > `send''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/function.rb:31:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>>
>> > `safeevaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:25:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>>
>> > `each''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>>
>> > `safeevaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource/type.rb:136:in
>>
>> > `evaluate_code''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:81:in
>>
>> > `evaluate''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:282:in
>>
>> > `evaluate_main''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:96:in
>>
>> > `compile_unadorned''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-hiera-puppet-1.0.0/lib/rspec-hiera-puppet/puppet.rb:16:in
>>
>> > `compile''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:29:in
>>
>> > `compile''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/catalog/compiler.rb:77:in
>>
>> > `compile''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/util.rb:184:in
>>
>> > `benchmark''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/catalog/compiler.rb:75:in
>>
>> > `compile''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/catalog/compiler.rb:35:in
>>
>> > `find''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/indirection.rb:191:in
>>
>> > `find''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/support.rb:18:in
>>
>> > `build_catalog_without_cache''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/support.rb:24:in
>>
>> > `build_catalog''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/example/class_example_group.rb:55:in
>>
>> > `catalogue''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/example/class_example_group.rb:7:in
>>
>> > `subject''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/subject.rb:64:in
>>
>> > `should''
>> > /home/nrhuff/repos/puppet-os/spec/classes/os_spec.rb:14
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in
>>
>> > `instance_eval''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in
>>
>> > `with_around_each_hooks''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in
>>
>> > `run_examples''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in
>>
>> > `map''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in
>>
>> > `run_examples''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in
>>
>> > `map''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in
>>
>> > `map''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in
>>
>> > `report''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in
>>
>> > `run''
>> >
>>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in
>>
>> > `autorun''
>> > /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/bin/rspec:19
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Puppet Users" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/puppet-users/-/CwP92gjyuusJ.
>> > To post to this group, send email to puppet...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > puppet-users...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/puppet-users?hl=en.
>>
>

--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit