Gavin Williams
2013-Dec-06 09:51 UTC
[Puppet Users] RSpec tests failing after upgrading to rspec-puppet v1.0.1
Morning all Not sure if anybody on here is going to be able to assist, but thought I''d ask anyways... I''ve upgraded rspec-puppet to v1.0.1 this morning, and now all my rspec tests are failing with: Failure/Error: it { should_not contain_class(''software::hp::psp'') }> Puppet::Error: > Puppet::Parser::AST::Resource failed with error TypeError: can''t > convert Hash into String at > /etc/puppet/environments/common/act/spec/fixtures/modules/act/manifests/software/linux/puppet_agent.pp:27 > on node puppet-dev.card.co.uk >The failure point quoted isn''t doing anything special. The code is here[1], and is failing at line 27. Running with backtrace, do get a fairly long trace, that seems to start in hiera code... [2] However that has been working fine prior to upgrading rspec-puppet. With regards to framework, I''m using puppetlabs-spec-helper, rspec-puppet and hiera-puppet-helper. I''ve got a hiera_config defined as a shared_context [3], so I''m wondering if the new hiera support in rspec-puppet is clashing with hiera-puppet-helper :s Any ideas appreciated. As there are some cool new features in rspec-puppet that I''d like to use, but can''t have all my tests breaking... Cheers Gavin [1] https://gist.github.com/fatmcgav/7821149#file-software_linux_puppet_agent-pp [2] https://gist.github.com/fatmcgav/7821149#file-failure-trace-log [3] https://gist.github.com/fatmcgav/7821149#file-hiera-rb -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/701b2ca3-e495-453f-8611-d6f3553ab327%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Gavin Williams
2013-Dec-06 11:12 UTC
[Puppet Users] Re: RSpec tests failing after upgrading to rspec-puppet v1.0.1
Ok, after raising on issue against rspec-puppet on Github, Tim responded with some more information... [1] Long and short is now that rspec-puppet supports Hiera, there''s no need to use hiera-puppet-helper or rspec-hiera-helper... Can set it all up from within rspec... Sample code from Tim and myself available on the aforementioned link... Cheers Gavin [1] https://github.com/rodjek/rspec-puppet/issues/131 On Friday, 6 December 2013 09:51:54 UTC, Gavin Williams wrote:> > Morning all > > Not sure if anybody on here is going to be able to assist, but thought I''d > ask anyways... > > I''ve upgraded rspec-puppet to v1.0.1 this morning, and now all my rspec > tests are failing with: > > Failure/Error: it { should_not contain_class(''software::hp::psp'') } >> Puppet::Error: >> Puppet::Parser::AST::Resource failed with error TypeError: can''t >> convert Hash into String at >> /etc/puppet/environments/common/act/spec/fixtures/modules/act/manifests/software/linux/puppet_agent.pp:27 >> on node puppet-dev.card.co.uk >> > > The failure point quoted isn''t doing anything special. The code is > here[1], and is failing at line 27. > > Running with backtrace, do get a fairly long trace, that seems to start in > hiera code... [2] > > However that has been working fine prior to upgrading rspec-puppet. > With regards to framework, I''m using puppetlabs-spec-helper, rspec-puppet > and hiera-puppet-helper. > > I''ve got a hiera_config defined as a shared_context [3], so I''m wondering > if the new hiera support in rspec-puppet is clashing with > hiera-puppet-helper :s > > Any ideas appreciated. As there are some cool new features in rspec-puppet > that I''d like to use, but can''t have all my tests breaking... > > Cheers > Gavin > > [1] > https://gist.github.com/fatmcgav/7821149#file-software_linux_puppet_agent-pp > [2] https://gist.github.com/fatmcgav/7821149#file-failure-trace-log > [3] https://gist.github.com/fatmcgav/7821149#file-hiera-rb >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f38501ca-0437-4273-b3ba-db865de62f3b%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.