On 11/1/16 6:12 AM, David Schmitt wrote:
> Hi Steve,
> 
> I can reproduce this locally, and it looks like some kind of setup issue
> around how (rspec-)puppet is loading lookup data.
> 
> I'll look into it, and keep you posted.
> 
> Regards, David
> 
> On Monday, October 31, 2016 at 2:39:54 AM UTC, Stephen Nesbitt wrote:
> 
>     All:
> 
>     I'm struggling to unit test a very simple profile with a dependency
>     on the ntp 5.0.0 module - the ntp version implementing module data.
>     The problem is that none of the default values for ntp are
>     visible/available to the unit test as indicated by the failure:
>     |
>       1) profile::ntp::client with default values for all parameters
>     profile::ntp::client should compile into a catalogue without
>     dependency cycles
>          Failure/Error: it { is_expected.to <http://is_expected.to>
>     compile.with_all_deps }
>          
>           error during compilation:EvaluationError:Errorwhileevaluating
>     a FunctionCall,Class[Ntp]:
>              expects a value forparameter 'autoupdate'
>              expects a value forparameter 'broadcastclient'
>              expects a value forparameter 'config'
>              ...
>     |
> 
> 
>     The profile::ntp::client class is very simple:
> 
>     |
>     classprofile::ntp::client {
>      include ::ntp
>     }
>     |
> 
>     My spec helper is:
> 
>     |
>     require'puppetlabs_spec_helper/module_spec_helper'
> 
>     RSpec.configure do|c|
>      c.after(:suite)do
>      RSpec::Puppet::Coverage.report!(95)
>      end
>     end
>     |
> 
>     My .fixtures.yml
> 
>     |
> 
>     fixtures:
>      forge_modules:
>      ntp:'puppetlabs/ntp'
>      stdlib:'puppetlabs/stdlib'
>      symlinks:
>      profile:"#{source_dir}/../profile"
>     |
> 
> 
>     My unit test:
> 
>     |
> 
>     require 'spec_helper'
> 
>     describe 'profile::ntp::client' do
>     context 'with default values for all parameters' do
>     describe 'profile::ntp::client' do
>     it { is_expected.to <http://is_expected.to> compile.with_all_deps }
>           # it { is_expected.to <http://is_expected.to>
>     contain_class('profile::ntp::client') }
>     # it { is_expected.to <http://is_expected.to> contain_class('::ntp') }
> 
>     end
>     end
>     end
> 
>     |
> 
>     Puppet version is 4.7.0. Host OS is ubuntu 16.04
> 
> 
>     Any help in resolving this would be much appreciated.
> 
> 
>     -steve
> 

Hi,

I noticed that your .fixtures.yml do not include versions. This means
that they will always test against the latest version. You probably want
to change this to use the version you actually use.

Best regards,
-g


-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/adc79629-9318-87d5-0194-d4a8f2f027bb%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to