Alexandros Kosiaris has submitted this change and it was merged. Change subject: nrpe: simplify tests with puppetlabs_spec_helper ......................................................................
nrpe: simplify tests with puppetlabs_spec_helper Dramatically simplify the way we run tests. See change on the network module: https://gerrit.wikimedia.org/r/#/c/296821 $ bundle install $ cd modules/postgresql $ bundle exec rake spec Add ferm and monitoring modules in .fixtures.yml. Some spec are failing, apparently due to change in the module that has not been reflected in the specs. Change-Id: I664f7f4098d9aea7b5296b14ba2fae8860dfd985 --- A modules/nrpe/.fixtures.yml A modules/nrpe/.gitignore M modules/nrpe/Rakefile 3 files changed, 7 insertions(+), 37 deletions(-) Approvals: Alexandros Kosiaris: Verified; Looks good to me, approved diff --git a/modules/nrpe/.fixtures.yml b/modules/nrpe/.fixtures.yml new file mode 100644 index 0000000..2c500f2 --- /dev/null +++ b/modules/nrpe/.fixtures.yml @@ -0,0 +1,5 @@ +fixtures: + symlinks: + nrpe: "#{source_dir}" + ferm: "../../../../ferm" + monitoring: "../../../../monitoring" diff --git a/modules/nrpe/.gitignore b/modules/nrpe/.gitignore new file mode 100644 index 0000000..25d69e9 --- /dev/null +++ b/modules/nrpe/.gitignore @@ -0,0 +1 @@ +spec/fixtures/modules/ diff --git a/modules/nrpe/Rakefile b/modules/nrpe/Rakefile index d9226a8..cd3d379 100644 --- a/modules/nrpe/Rakefile +++ b/modules/nrpe/Rakefile @@ -1,37 +1 @@ -require 'rake' -require 'fileutils' - -require 'rspec/core/rake_task' - -modulename = File.basename(File.expand_path(File.dirname(__FILE__))) - -symlinks = { 'spec/fixtures/modules/%s/files' % modulename => '../../../../files', - 'spec/fixtures/modules/%s/manifests' % modulename => '../../../../manifests', - 'spec/fixtures/modules/%s/templates' % modulename => '../../../../templates', -} - - -task :setup do - FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename) - symlinks.each do |x| - if !File.exist?(x[0]) - FileUtils.ln_s(x[1], x[0]) - end - end -end - -task :teardown do - symlinks.each { |x| FileUtils.rm(x[0], :force => true) } - FileUtils.rmdir('spec/fixtures/modules/%s' % modulename) - FileUtils.rmdir('spec/fixtures/modules') -end - -RSpec::Core::RakeTask.new(:realspec) do |t| - t.fail_on_error = false - t.pattern = 'spec/*/*_spec.rb' -end - -task :spec => [ :setup, :realspec, :teardown] - -task :default => :spec do -end +require 'puppetlabs_spec_helper/rake_tasks' -- To view, visit https://gerrit.wikimedia.org/r/296881 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I664f7f4098d9aea7b5296b14ba2fae8860dfd985 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Hashar <has...@free.fr> Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org> Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Gehel <gleder...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits