On 9.6.2012 22:06, Branan Purvine-Riley wrote:
> Hi,
> 
> Thanks for the bug report. None of the modules we developed the spec helper
> against use hiera, so it's great to hear from the community on this.
> 
> I've implemented basic hiera support. I'd appreciate any feedback you have
> on it, especially suggestions on how to make sure hiera-based modules can
> be tested effectively.
> 
> https://github.com/puppetlabs/puppetlabs_spec_helper/pull/11

I tried this, finally.

For me the generated hiera.yaml is missing the puppet backend.
I changed it a little.

:backends:
  - yaml
  - puppet

:puppet:
   :datasource: data

Apart from the question if this is a change that should go into the
generated hiera.yaml , if someone has special needs, it would help if
the hiera.yaml is not overwritten every time. If it exists, leave it alone.

Another idea: to provide per-test-data I could say

:hierarchy:
  - %spec_hiera
  - spec_hiera

an set a spec_hiera fact in the rspec test.
I didn't try that because I ran into another error message

15) mdraid active mdraid
     Failure/Error: :ensure => nil)
     Puppet::Error:
       can't convert nil into String at ...

These errors happens at those lines in the manifests when hiera is
called. I did a very simple dtrace for the open syscalls and hiera.yaml
is opened once, for writing I assume. I would have expected that it
would have to be read afterwards by hiera. spec/fixtures/spec_hiera.yaml
is not tried at all.
I don't know how to properly debug this.

Sorry for the long delay,
Markus

> On Sat, Jun 9, 2012 at 3:28 AM, Markus Falb <markus.f...@fasel.at> wrote:
> 
>> Hi,
>> I tried the new puppetlabs_spec_helper and ran into the following.
>>
>> After I put hiera in .fixtures.yml it does not complain about missing
>> function hiera() but now all tests where hiera is used are failing with
>> another message.
>>
>> Puppet::Error: Hiera config file /dev/null/hiera.yaml not readable
>>
>> I stumbled about something similar, see
>>
>> http://groups.google.com/group/puppet-dev/tree/browse_frm/thread/e47299ece604a2d2/38073019a03b487a
>>
>> I have no idea how or where to fix this.
>> I use puppet 2.6.16
>> --
>> Kind Regards, Markus Falb
>>
>>
> 


-- 
Kind Regards, Markus Falb

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to