Nicko has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282484

Change subject: Modification of Rakefile
......................................................................

Modification of Rakefile

Changing rake task executed by default plus adding
puppetlabs_spec_helper gem in the Gemfile, cleanup
improvement in teardown task

Bug:T78342
Change-Id: I7bf2fe24c063b686ad826082e735d09b0767670a
---
M Gemfile
M Gemfile.lock
M Rakefile
M modules/backup/Rakefile
M modules/bacula/Rakefile
M modules/base/Rakefile
M modules/git/Rakefile
M modules/install_server/Rakefile
M modules/mirrors/Rakefile
M modules/mysql/Rakefile
M modules/nrpe/Rakefile
M modules/osm/Rakefile
M modules/postgresql/Rakefile
M modules/rsync/Rakefile
M modules/servermon/Rakefile
M modules/service/Rakefile
M modules/squid3/Rakefile
M modules/stdlib/Rakefile
M modules/strongswan/Rakefile
M modules/wmflib/Rakefile
20 files changed, 43 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/84/282484/1

diff --git a/Gemfile b/Gemfile
index 86513f6..a3bc8a8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,6 +2,7 @@
 
 gem 'puppet', '~> 3.4.3'
 gem 'rspec-puppet', '~> 2.3.2'
+gem 'puppetlabs_spec_helper'
 
 gem 'rake', '~> 10.4', '>= 10.4.2'
 gem 'rubocop', '~> 0.35.1', require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 36d1336..4bab863 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -9,6 +9,9 @@
     hiera (1.3.4)
       json_pure
     json_pure (1.8.3)
+    metaclass (0.0.4)
+    mocha (1.1.0)
+      metaclass (~> 0.0.1)
     parser (2.2.3.0)
       ast (>= 1.1, < 3.0)
     powerpack (0.1.1)
@@ -16,6 +19,15 @@
       facter (~> 1.6)
       hiera (~> 1.0)
       rgen (~> 0.6.5)
+    puppet-lint (1.1.0)
+    puppet-syntax (2.1.0)
+      rake
+    puppetlabs_spec_helper (1.1.1)
+      mocha
+      puppet-lint
+      puppet-syntax
+      rake
+      rspec-puppet
     rainbow (2.0.0)
     rake (10.4.2)
     rgen (0.6.6)
@@ -49,6 +61,7 @@
 
 DEPENDENCIES
   puppet (~> 3.4.3)
+  puppetlabs_spec_helper
   rake (~> 10.4, >= 10.4.2)
   rspec-puppet (~> 2.3.2)
   rubocop (~> 0.35.1)
diff --git a/Rakefile b/Rakefile
index 79615e6..f224c55 100644
--- a/Rakefile
+++ b/Rakefile
@@ -201,7 +201,7 @@
         system("touch #{site_file_name}") unless File.exists?(site_file_name)
 
         puts "Invoking tests on module #{module_name}"
-        system('rake spec_standalone')
+        system('rake spec')
     end
 end
 
diff --git a/modules/backup/Rakefile b/modules/backup/Rakefile
index d9226a8..e94f2c5 100644
--- a/modules/backup/Rakefile
+++ b/modules/backup/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/bacula/Rakefile b/modules/bacula/Rakefile
index d9226a8..e94f2c5 100644
--- a/modules/bacula/Rakefile
+++ b/modules/bacula/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/base/Rakefile b/modules/base/Rakefile
index 165b532..5f44960 100644
--- a/modules/base/Rakefile
+++ b/modules/base/Rakefile
@@ -33,7 +33,7 @@
   extra_modules.each do |x|
       FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true)
   end
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/git/Rakefile b/modules/git/Rakefile
index cd3d379..221d85b 100644
--- a/modules/git/Rakefile
+++ b/modules/git/Rakefile
@@ -1 +1,4 @@
 require 'puppetlabs_spec_helper/rake_tasks'
+
+task :spec => :spec_standalone do
+end
diff --git a/modules/install_server/Rakefile b/modules/install_server/Rakefile
index 0542f30..1c930d9 100644
--- a/modules/install_server/Rakefile
+++ b/modules/install_server/Rakefile
@@ -33,7 +33,7 @@
   extra_modules.each do |x|
       FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true)
   end
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/mirrors/Rakefile b/modules/mirrors/Rakefile
index 0542f30..1c930d9 100644
--- a/modules/mirrors/Rakefile
+++ b/modules/mirrors/Rakefile
@@ -33,7 +33,7 @@
   extra_modules.each do |x|
       FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true)
   end
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/mysql/Rakefile b/modules/mysql/Rakefile
index cd3d379..221d85b 100644
--- a/modules/mysql/Rakefile
+++ b/modules/mysql/Rakefile
@@ -1 +1,4 @@
 require 'puppetlabs_spec_helper/rake_tasks'
+
+task :spec => :spec_standalone do
+end
diff --git a/modules/nrpe/Rakefile b/modules/nrpe/Rakefile
index d9226a8..e94f2c5 100644
--- a/modules/nrpe/Rakefile
+++ b/modules/nrpe/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/osm/Rakefile b/modules/osm/Rakefile
index d9226a8..e94f2c5 100644
--- a/modules/osm/Rakefile
+++ b/modules/osm/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/postgresql/Rakefile b/modules/postgresql/Rakefile
index d9226a8..e94f2c5 100644
--- a/modules/postgresql/Rakefile
+++ b/modules/postgresql/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/rsync/Rakefile b/modules/rsync/Rakefile
index 14f1c24..f724918 100644
--- a/modules/rsync/Rakefile
+++ b/modules/rsync/Rakefile
@@ -1,2 +1,5 @@
 require 'rubygems'
 require 'puppetlabs_spec_helper/rake_tasks'
+
+task :spec => :spec_standalone do
+end
diff --git a/modules/servermon/Rakefile b/modules/servermon/Rakefile
index 165b532..5f44960 100644
--- a/modules/servermon/Rakefile
+++ b/modules/servermon/Rakefile
@@ -33,7 +33,7 @@
   extra_modules.each do |x|
       FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true)
   end
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/service/Rakefile b/modules/service/Rakefile
index c3293b0..599ab61 100644
--- a/modules/service/Rakefile
+++ b/modules/service/Rakefile
@@ -34,7 +34,7 @@
   sh "nosetests spec/checker/"
 end
 
-task :spec_standalone => [ :setup, :test_checker, :realspec, :teardown]
+task :spec => [ :setup, :test_checker, :realspec, :teardown]
 
-task :default => :spec_standalone do
+task :default => :spec do
 end
diff --git a/modules/squid3/Rakefile b/modules/squid3/Rakefile
index 5bed768..8fec3fd 100644
--- a/modules/squid3/Rakefile
+++ b/modules/squid3/Rakefile
@@ -31,7 +31,7 @@
   extra_modules.each do |x|
       FileUtils.rm('spec/fixtures/modules/%s' % x, :force => true)
   end
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
diff --git a/modules/stdlib/Rakefile b/modules/stdlib/Rakefile
index 14f1c24..f724918 100644
--- a/modules/stdlib/Rakefile
+++ b/modules/stdlib/Rakefile
@@ -1,2 +1,5 @@
 require 'rubygems'
 require 'puppetlabs_spec_helper/rake_tasks'
+
+task :spec => :spec_standalone do
+end
diff --git a/modules/strongswan/Rakefile b/modules/strongswan/Rakefile
index a0c3b79..039314c 100644
--- a/modules/strongswan/Rakefile
+++ b/modules/strongswan/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
@@ -31,7 +31,7 @@
   t.pattern = 'spec/*/*_spec.rb'
 end
 
-task :spec_standalone => [ :setup, :realspec, :teardown]
+task :spec => [ :setup, :realspec, :teardown]
 
 task :default => :spec do
 end
diff --git a/modules/wmflib/Rakefile b/modules/wmflib/Rakefile
index a0c3b79..039314c 100644
--- a/modules/wmflib/Rakefile
+++ b/modules/wmflib/Rakefile
@@ -23,7 +23,7 @@
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
   FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
+  FileUtils.rm('spec/fixtures/modules')
 end
 
 RSpec::Core::RakeTask.new(:realspec) do |t|
@@ -31,7 +31,7 @@
   t.pattern = 'spec/*/*_spec.rb'
 end
 
-task :spec_standalone => [ :setup, :realspec, :teardown]
+task :spec => [ :setup, :realspec, :teardown]
 
 task :default => :spec do
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bf2fe24c063b686ad826082e735d09b0767670a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Nicko <nicko.gla...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to