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 compile.with_all_deps } error during compilation: Evaluation Error: Error while evaluating a Function Call, Class[Ntp]:
expects a value for parameter 'autoupdate'
expects a value for parameter 'broadcastclient'
expects a value for parameter 'config'
...
class profile::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
endMy .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 compile.with_all_deps }
# it { is_expected.to contain_class('profile::ntp::client') }
# it { is_expected.to contain_class('::ntp') }
end
end
endPuppet version is 4.7.0. Host OS is ubuntu 16.04Any help in resolving this would be much appreciated.-steve
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.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/ph6_kdzr0Ec/unsubscribe.
To unsubscribe from this group and all its topics, 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/8df9baef-ea18-4b1f-80f1-184a98566e49%40googlegroups.com.
--fixtures: symlinks: [module_name]: "#{source_dir}"
#!/usr/bin/env ruby
forge 'http://forge.puppetlabs.com'
metadata
# mod 'puppet-archive',# :git => 'https://github.com/fatmcgav/puppet-archive.git',# :ref => 'support-1.8.7-puppet4'
# use librarian-puppet to manage fixtures instead of .fixtures.yml# offers more possibilities like explicit version management, forge downloads,...task :librarian_spec_prep do sh "librarian-puppet install --path=spec/fixtures/modules/"endtask :spec_prep => :librarian_spec_preptask :librarian_clean do sh "librarian-puppet clean"end
StephenIf you're already using R10k or Librarian-Puppet, as indicated by the Puppetfile, then it should be possible to simplify that...
For example, my .fixtures.yml looks like:
--fixtures:symlinks:[module_name]: "#{source_dir}"
Puppetfile:
#!/usr/bin/env rubyforge 'http://forge.puppetlabs.com'metadata# mod 'puppet-archive',# :git => 'https://github.com/fatmcgav/puppet-archive.git',# :ref => 'support-1.8.7-puppet4'The Puppetfile above pulls a list of required modules from your metadata.json file, and Librarian-Puppet takes care of installing and resolving deps...Rakefile addition:
# use librarian-puppet to manage fixtures instead of .fixtures.yml# offers more possibilities like explicit version management, forge downloads,...task :librarian_spec_prep dosh "librarian-puppet install --path=spec/fixtures/modules/"endtask :spec_prep => :librarian_spec_preptask :librarian_clean dosh "librarian-puppet clean"end
HTHGav
On Wednesday, 2 November 2016 16:41:03 UTC, Stephen Nesbitt wrote:Garrett - Thanks for the heads up!David - thanks for the comment!I will note that I am now maintaining dependency information in 3 locations - Puppetfile, metdata.json and .fixtures, Guess what is going to happen at some point ;-)Maybe I'm not aware of something, but there really should be a single canonical source of dependency requirements.-steve
On Wednesday, November 2, 2016 at 6:55:05 AM UTC-7, David Schmitt wrote:
On Tuesday, November 1, 2016 at 7:25:01 PM UTC, Garrett Honeycutt wrote: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.
That really depends on the amount of time and the cadence people are willing to invest in staying up-to-date. Shops with strict version requirements and a waterfall-y workflow really should do that. Others with a more fluid/agile/pipeline-oriented workflow are much better suited to address upcomping changes when they happen, instead of batching it up.
Cheers, D.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/ph6_kdzr0Ec/unsubscribe.
To unsubscribe from this group and all its topics, 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/e546756d-b24d-417c-9d78-0d8162210edc%40googlegroups.com.
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/CALF7fHY64QLggrRh%3DcHm-6kfFZSYoEQE%2BdyeK-XUucQs9zgYzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.