On Wed, Sep 10, 2014 at 8:39 AM, Brett Swift <[email protected]> wrote:

> I see your points on wanting to know what your dependencies are, and maybe
> I'm missing something on how puppet's module path works.   As I understand
> Puppet will resolve the first module on the path if it sees multiple.
>
> Modules should use semantic versioning, so lets assume that in a
> hypothetical.
>
> Also lets assume that I'm developing a module with two direct
> dependencies, that each depend on stdlib.   However one relies on 3.x.x and
> one 4.x.x.    I assume that Puppet can only use one of those.. so which
> one?
>

That's a good question and is part of the reason I disabled the automatic
dependency resolution. I have no idea what you'd do in that case nor what
the PMT would do, so it's up to the person writing the tests to decide.


> It does beg one simple question though.   Why wouldn't rspec_puppet_helper
>  forgo .fixtures.yml, instead of using metadata.json?   It's a tight
> coupling..  but maybe a coupling that would be a good idea?
>

Something I've wondered myself too; I think it's partly an historical
accident --  For a long time, neither the PMT nor puppetlabs_spec_helper
were part of Puppet itself; now the PMT is but spec_helper already has an
entrenched user base.

Another good reason for them to be separate is to enable a more minimal
testing environment. For example, recently I was writing tests for a new
module that needed a function from another module I'd written, so either
I'd have to add the other module to my fixtures and stub the Ruby library
calls the function made or I could exclude the other module and just stub
the Puppet function -- that latter was simplest and it would have been
messier to have the module installed as a fixture and try to stub the
function. (For reference, the MockFunction class from rspec-puppet-utils
seems to be the easiest way to stub Puppet functions.)

And yet another good reason to keep them separate is to enable testing with
various combinations of dependency versions. At least, one could if someone
were to write the code to make the name of the fixtures file selectable...

Wil

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMmm3r6d9DNsF3f4i0bysR3awYVc5rcbVXgY%3DmXyg_6hKn4pkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to