Hashar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361577 )

Change subject: aptrepo: fix spec
......................................................................

aptrepo: fix spec

Tests depends on wmflib and apt (for apt::pin)
Stub Exec['apt-get update']

Provide default facts for Jessie. A better fix would be to use
https://github.com/mcanevet/rspec-puppet-facts and run tests against
multiple supported operating systems.

Change-Id: I95af3d6ee189495de4c3bd7cc4107164b85e7803
---
M modules/aptrepo/.fixtures.yml
M modules/aptrepo/spec/classes/aptrepo_spec.rb
M modules/aptrepo/spec/spec_helper.rb
3 files changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/77/361577/1

diff --git a/modules/aptrepo/.fixtures.yml b/modules/aptrepo/.fixtures.yml
index 295a319..c638d818 100644
--- a/modules/aptrepo/.fixtures.yml
+++ b/modules/aptrepo/.fixtures.yml
@@ -1,4 +1,6 @@
 fixtures:
     symlinks:
         aptrepo: "#{source_dir}"
+        apt: "../../../../apt"
         ssh: "../../../../ssh"
+        wmflib: "../../../../wmflib"
diff --git a/modules/aptrepo/spec/classes/aptrepo_spec.rb 
b/modules/aptrepo/spec/classes/aptrepo_spec.rb
index a95f735..590f2a8 100644
--- a/modules/aptrepo/spec/classes/aptrepo_spec.rb
+++ b/modules/aptrepo/spec/classes/aptrepo_spec.rb
@@ -2,6 +2,10 @@
 
 describe 'aptrepo', :type => :class do
     let(:params) {{ :basedir => '/srv/wikimedia' }}
+    let(:pre_condition) {
+        # Stub for the ::apt module
+        "exec { 'apt-get update': path => '/bin/true' }"
+    }
 
     it { should compile }
 
diff --git a/modules/aptrepo/spec/spec_helper.rb 
b/modules/aptrepo/spec/spec_helper.rb
index d3923f8..6be7efd 100644
--- a/modules/aptrepo/spec/spec_helper.rb
+++ b/modules/aptrepo/spec/spec_helper.rb
@@ -5,4 +5,9 @@
 RSpec.configure do |c|
   c.module_path = File.join(fixture_path, 'modules')
   c.manifest_dir = File.join(fixture_path, 'manifests')
+  c.default_facts = {
+    :initsystem => 'systemd',
+    :lsbdistid => 'Debian',
+    :lsbdistrelease => '8.0',
+  }
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/361577
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95af3d6ee189495de4c3bd7cc4107164b85e7803
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to