diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ea59806..5f40b09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,42 +1,41 @@ --- stages: - syntax - unit cache: paths: - vendor/bundle before_script: - bundle -v - rm Gemfile.lock || true - gem update --system $RUBYGEMS_VERSION - gem --version - bundle -v - bundle install --without system_tests --path vendor/bundle --jobs $(nproc) -parallel_spec-Ruby 2.1.9-Puppet ~> 4.0: - stage: unit - image: ruby:2.1.9 +syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.1-Puppet ~> 6.0: + stage: syntax + image: ruby:2.5.1 script: - - bundle exec rake parallel_spec + - bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop variables: - PUPPET_GEM_VERSION: '~> 4.0' - RUBYGEMS_VERSION: '2.7.8' + PUPPET_GEM_VERSION: '~> 6.0' -syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5: - stage: syntax - image: ruby:2.4.4 +parallel_spec-Ruby 2.5.1-Puppet ~> 6.0: + stage: unit + image: ruby:2.5.1 script: - - bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + - bundle exec rake parallel_spec variables: - PUPPET_GEM_VERSION: '~> 5.5' + PUPPET_GEM_VERSION: '~> 6.0' -parallel_spec-Ruby 2.4.4-Puppet ~> 5.5: +parallel_spec-Ruby 2.4.4-Puppet ~> 5.0: stage: unit image: ruby:2.4.4 script: - bundle exec rake parallel_spec variables: - PUPPET_GEM_VERSION: '~> 5.5' + PUPPET_GEM_VERSION: '~> 5.0' diff --git a/metadata.json b/metadata.json index be908d1..3c191d5 100644 --- a/metadata.json +++ b/metadata.json @@ -1,103 +1,103 @@ { "name": "ssm-munin", "version": "0.1.0", "author": "ssm", "summary": "Configure munin master, node and plugins", "license": "Apache-2.0", "source": "https://github.com/ssm/ssm-munin", "project_page": "https://github.com/ssm/ssm-munin", "issues_url": "https://github.com/ssm/ssm-munin/issues", "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 2.3.0 < 6.0.0" } ], "operatingsystem_support": [ { "operatingsystem": "Archlinux", "operatingsystemrelease": [ "4" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "8", "9" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "SmartOS" }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "16.04", "18.04" ] }, { "operatingsystem": "FreeBSD", "operatingsystemrelease": [ "9", "10" ] }, { "operatingsystem": "DragonFly" }, { "operatingsystem": "OpenBSD" } ], "requirements": [ { "name": "puppet", "version_requirement": ">= 4.7.0 < 6.0.0" } ], "tags": [ "munin", "monitoring", "graphing", "performance", "trending" ], "pdk-version": "1.9.0", - "template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git", - "template-ref": "1.9.0-0-g7281db5" -} + "template-url": "https://github.com/puppetlabs/pdk-templates", + "template-ref": "1.9.1-0-g6945d31" +} \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0d5efc0..70d81e0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,47 +1,51 @@ +RSpec.configure do |c| + c.mock_with :rspec +end + require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) include RspecPuppetFacts default_facts = { puppetversion: Puppet.version, facterversion: Facter.version, } default_fact_files = [ File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), ] default_fact_files.each do |f| next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f))) + default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) rescue => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end end RSpec.configure do |c| c.default_facts = default_facts c.before :each do # set to strictest setting for testing # by default Puppet runs at warning level Puppet.settings[:strict] = :warning end c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] c.after(:suite) do end end def ensure_module_defined(module_name) module_name.split('::').reduce(Object) do |last_module, next_module| last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) last_module.const_get(next_module, false) end end # 'spec_overrides' from sync.yml will appear below this line