From 13329da1e3e4104ba899a946ccd6e189ae5f7d3d Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 29 Sep 2023 16:16:31 +0200 Subject: [PATCH] Update gems to support testing Puppet 8 --- .gitignore | 3 ++- CONTRIBUTING.md | 2 +- Gemfile | 18 +++++------------- spec/spec_helper.rb | 3 +++ 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 77892f5c..a5f47aa2 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,8 @@ vendor/ .ruby-* ## rspec -spec/fixtures/ +spec/fixtures/manifests +spec/fixtures/modules junit/ ## Puppet module diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f6b9552..a4c162fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -194,7 +194,7 @@ More filter info available [here](https://relishapp.com/rspec/rspec-core/v/3-9/d To run OS specific tests: ```shell -SPEC_FACTS_OS=redhat-7-x86_64 bundle exec rspec spec/classes/foreman_spec.rb +SPEC_FACTS_OS=redhat-8-x86_64 bundle exec rspec spec/classes/foreman_spec.rb ``` If you have more than one version of `redhat` OS specified in metadata.json, diff --git a/Gemfile b/Gemfile index 89f86f82..873afcb7 100644 --- a/Gemfile +++ b/Gemfile @@ -3,24 +3,16 @@ source 'https://rubygems.org' -gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test'] +gem 'puppet', ENV.fetch('PUPPET_GEM_VERSION', '>= 7'), groups: ['development', 'test'] gem 'rake' gem 'kafo_module_lint', {"groups"=>["test"]} -gem 'puppet-lint-empty_string-check', {"groups"=>["test"]} -gem 'puppet-lint-file_ensure-check', {"groups"=>["test"]} -gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]} -gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]} -gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]} -gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]} -gem 'voxpupuli-test', '~> 5.0', {"groups"=>["test"]} +gem 'puppet-lint-spaceship_operator_without_tag-check', '~> 1.0', {"groups"=>["test"]} +gem 'voxpupuli-test', '~> 7.0', {"groups"=>["test"]} gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]} -gem 'puppet_metadata', '~> 1.3' +gem 'puppet_metadata', '~> 3.0' gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]} -gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]} +gem 'voxpupuli-acceptance', '~> 2.0', {"groups"=>["system_tests"]} gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]} -# Pin rdoc to prevent updating bundled psych (https://github.com/ruby/rdoc/commit/ebe185c8775b2afe844eb3da6fa78adaa79e29a4) -gem 'rdoc', '< 6.4' - # vim:ft=ruby diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 950b5d86..9c4d3afe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,9 @@ add_mocked_facts! +add_custom_fact :systemd, true # puppet-systemd +add_custom_fact :root_home, "/root" # puppetlabs-stdlib + def get_content(subject, title) is_expected.to contain_file(title) content = subject.resource('file', title).send(:parameters)[:content]