FAQ
I've been working on getting spec tests on all of my modules and am down to ones that use hiera and don't have any reasonable defaults. It looks like there is a project on GH (https://github.com/amfranz/rspec-hiera-puppet) that is designed to fill this need, but for the life of me I cannot make it work. FriedBob helped out on the IRC channel some with his solution of including a patch to puppetlabs_spec_helper that was pulled pending further discussion (https://github.com/puppetlabs/puppetlabs_spec_helper/pull/16).

I've attempted to make a working example using both the basic and advanced methods of rspec-hiera-puppet (I can live with either one) but cannot get them to work. Does anyone have any experience with this they can lend me a hand? This doesn't seem like it should be this hard - I have to be missing something easy.

https://github.com/jlambert121/rspec-hiera-puppet-basic
https://github.com/jlambert121/rspec-hiera-puppet-advanced

Thanks,
jl



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Justin Lambert at Feb 20, 2013 at 1:53 pm
    I have been revisiting this again lately and still haven't been able to get any spec tests working with hiera. Has anyone else had any luck in the last few months? It is easy to make hiera lookups work if there is a default, but I can't seem to write a spec test that provides data to a hiera lookup without a default or to override a default.

    Thanks,
    jl
    On Dec 17, 2012, at 10:24 AM, Justin Lambert wrote:

    I've been working on getting spec tests on all of my modules and am down to ones that use hiera and don't have any reasonable defaults. It looks like there is a project on GH (https://github.com/amfranz/rspec-hiera-puppet) that is designed to fill this need, but for the life of me I cannot make it work. FriedBob helped out on the IRC channel some with his solution of including a patch to puppetlabs_spec_helper that was pulled pending further discussion (https://github.com/puppetlabs/puppetlabs_spec_helper/pull/16).

    I've attempted to make a working example using both the basic and advanced methods of rspec-hiera-puppet (I can live with either one) but cannot get them to work. Does anyone have any experience with this they can lend me a hand? This doesn't seem like it should be this hard - I have to be missing something easy.

    https://github.com/jlambert121/rspec-hiera-puppet-basic
    https://github.com/jlambert121/rspec-hiera-puppet-advanced

    Thanks,
    jl




    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@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 unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Llowder at Feb 20, 2013 at 2:04 pm

    On Wednesday, February 20, 2013 7:45:41 AM UTC-6, Justin Lambert wrote:
    I have been revisiting this again lately and still haven't been able to
    get any spec tests working with hiera. Has anyone else had any luck in the
    last few months? It is easy to make hiera lookups work if there is a
    default, but I can't seem to write a spec test that provides data to a
    hiera lookup without a default or to override a default.
    Before I updated to puppet 3, I patched my copy of puppetlabs_spec_helper
    so that it would create things it needed to let me test with hiera.
    Unfortunately, i have not kept up with my tests and have been unable to
    make sure they still work on puppet3.

    It is on my list, and I will give an update once I am able to.

    Thanks,
    jl

    On Dec 17, 2012, at 10:24 AM, Justin Lambert wrote:

    I've been working on getting spec tests on all of my modules and am down
    to ones that use hiera and don't have any reasonable defaults. It looks
    like there is a project on GH (
    https://github.com/amfranz/rspec-hiera-puppet) that is designed to fill
    this need, but for the life of me I cannot make it work. FriedBob helped
    out on the IRC channel some with his solution of including a patch to
    puppetlabs_spec_helper that was pulled pending further discussion (
    https://github.com/puppetlabs/puppetlabs_spec_helper/pull/16).

    I've attempted to make a working example using both the basic and advanced
    methods of rspec-hiera-puppet (I can live with either one) but cannot get
    them to work. Does anyone have any experience with this they can lend me a
    hand? This doesn't seem like it should be this hard - I have to be missing
    something easy.

    https://github.com/jlambert121/rspec-hiera-puppet-basic
    https://github.com/jlambert121/rspec-hiera-puppet-advanced

    Thanks,
    jl




    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    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 unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Maarten Thibaut at Apr 3, 2013 at 2:56 pm
    Hi Justin,

    I have just forked rspec-hiera-puppet on github, reverting some code
    changes made in version 1.0.0 by the original author. Tests work for me
    with this code, can you test this out? One way is to do a "bundle" to get
    the (broken) version installed, then go to your gems dir, move away the
    rspec-hiera-puppet-1.0.0 dir, clone my repo (git clone
    http://github.com/mthibaut/rspec-hiera-puppet.git) and rename it
    "rspec-hiera-puppet-1.0.0".

    Do the tests work this way?

    --
    maarten
    On Wednesday, February 20, 2013 2:45:41 PM UTC+1, Justin Lambert wrote:

    I have been revisiting this again lately and still haven't been able to
    get any spec tests working with hiera. Has anyone else had any luck in the
    last few months? It is easy to make hiera lookups work if there is a
    default, but I can't seem to write a spec test that provides data to a
    hiera lookup without a default or to override a default.

    Thanks,
    jl

    On Dec 17, 2012, at 10:24 AM, Justin Lambert wrote:

    I've been working on getting spec tests on all of my modules and am down
    to ones that use hiera and don't have any reasonable defaults. It looks
    like there is a project on GH (
    https://github.com/amfranz/rspec-hiera-puppet) that is designed to fill
    this need, but for the life of me I cannot make it work. FriedBob helped
    out on the IRC channel some with his solution of including a patch to
    puppetlabs_spec_helper that was pulled pending further discussion (
    https://github.com/puppetlabs/puppetlabs_spec_helper/pull/16).

    I've attempted to make a working example using both the basic and advanced
    methods of rspec-hiera-puppet (I can live with either one) but cannot get
    them to work. Does anyone have any experience with this they can lend me a
    hand? This doesn't seem like it should be this hard - I have to be missing
    something easy.

    https://github.com/jlambert121/rspec-hiera-puppet-basic
    https://github.com/jlambert121/rspec-hiera-puppet-advanced

    Thanks,
    jl




    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    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 unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedDec 17, '12 at 5:24p
activeApr 3, '13 at 2:56p
posts4
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase