Giuseppe Lavagetto has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/403189 )
Change subject: service: properly fix specs for puppet 4 ...................................................................... service: properly fix specs for puppet 4 Change-Id: I2f206c4719d94176eb2291917411bf8f14c9104b --- M modules/service/spec/defines/service_node_spec.rb M modules/service/spec/spec_helper.rb 2 files changed, 33 insertions(+), 18 deletions(-) Approvals: Giuseppe Lavagetto: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/service/spec/defines/service_node_spec.rb b/modules/service/spec/defines/service_node_spec.rb index 7d2fd92..3c6ebaa 100644 --- a/modules/service/spec/defines/service_node_spec.rb +++ b/modules/service/spec/defines/service_node_spec.rb @@ -1,26 +1,39 @@ require 'spec_helper' +test_on = { + supported_os: [ + { + 'operatingsystem' => 'Debian', + 'operatingsystemrelease' => ['8', '9'], + } + ] +} describe 'service::node', :type => :define do - let(:pre_condition) { - ['class passwords::etcd { $accounts = {}}', - 'include ::passwords::etcd', - 'class profile::base { - $notifications_enabled = "1" -} -include ::profile::base' - ] - } - let(:title) { 'my_service_name' } - let(:facts) { { :initsystem => 'systemd' } } - let(:node_params) { {'cluster' => 'test', 'site' => 'eqiad', 'realm' => 'production'} } - context 'when only port is given' do - let(:params) { { :port => 1234 } } + on_supported_os(test_on).each do |os, facts| + context "On #{os}" do + let(:facts) do + facts.merge({initsystem: 'systemd'}) + end - it { is_expected.to compile } + let(:pre_condition) { + ['class passwords::etcd { $accounts = {}}', + 'include ::passwords::etcd', + 'class profile::base { $notifications_enabled = "1"}', + 'include ::profile::base' + ] + } + let(:title) { 'my_service_name' } + let(:node_params) { {'cluster' => 'test', 'site' => 'eqiad', 'realm' => 'production'} } + context 'when only port is given' do + let(:params) { { :port => 1234 } } - it 'create the appropriate scap target' do - is_expected.to contain_scap__target('my_service_name/deploy') - .with_service_name('my_service_name') + it { is_expected.to compile } + + it 'create the appropriate scap target' do + is_expected.to contain_scap__target('my_service_name/deploy') + .with_service_name('my_service_name') + end + end end end end diff --git a/modules/service/spec/spec_helper.rb b/modules/service/spec/spec_helper.rb index 26af1be..d44ced8 100644 --- a/modules/service/spec/spec_helper.rb +++ b/modules/service/spec/spec_helper.rb @@ -1,5 +1,7 @@ require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec-puppet-facts' +include RspecPuppetFacts fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |c| -- To view, visit https://gerrit.wikimedia.org/r/403189 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f206c4719d94176eb2291917411bf8f14c9104b Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org> Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org> Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org> Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits