Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "(maint) Exclude breaking rubocop versions" #570

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ group :test do
gem 'rspec-collection_matchers', '~> 1.0'
gem 'rspec-its', '~> 1.0'

gem 'rubocop', '~> 1.50.0'
gem 'rubocop-rspec', '~> 2.19'
gem 'rubocop', '~> 1.64.0'
gem 'rubocop-rspec', '~> 3.0'
gem 'rubocop-performance', '~> 1.16'
gem 'rubocop-factory_bot', '!= 2.26.0', require: false
gem 'rubocop-rspec_rails', '!= 2.29.0', require: false

gem 'simplecov'
gem 'simplecov-console'
Expand Down
2 changes: 1 addition & 1 deletion exe/matrix.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"OracleLinux": {
"7": { "x86_64": "litmusimage/oraclelinux:7" },
"8": { "x86_64": "litmusimage/oraclelinux:8" },
"8": { "x86_64": "litmusimage/oraclelinux:9" }
"9": { "x86_64": "litmusimage/oraclelinux:9" }
},
"Scientific": {
"7": { "x86_64": "litmusimage/scientificlinux:7" }
Expand Down
2 changes: 1 addition & 1 deletion exe/matrix_from_metadata_v3
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ begin

# union regexp option values
%w[platform arch].each do |c|
["#{c}_exclude".to_sym, "#{c}_include".to_sym].each do |k|
[:"#{c}_exclude", :"#{c}_include"].each do |k|
options[k] = if options[k].empty?
nil
else
Expand Down
8 changes: 2 additions & 6 deletions lib/puppet_litmus/inventory_manipulation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
# @return [Hash] hash of the litmus_inventory.yaml file.
def inventory_hash_from_inventory_file(inventory_full_path = nil)
require 'yaml'
inventory_full_path = if inventory_full_path.nil?
"#{Dir.pwd}/spec/fixtures/litmus_inventory.yaml"
else
inventory_full_path
end
inventory_full_path = "#{Dir.pwd}/spec/fixtures/litmus_inventory.yaml" if inventory_full_path.nil?

Check warning on line 13 in lib/puppet_litmus/inventory_manipulation.rb

View check run for this annotation

Codecov / codecov/patch

lib/puppet_litmus/inventory_manipulation.rb#L13

Added line #L13 was not covered by tests
raise "There is no inventory file at '#{inventory_full_path}'." unless File.exist?(inventory_full_path)

YAML.load_file(inventory_full_path)
Expand Down Expand Up @@ -103,7 +99,7 @@
output_collector = []
targets_in_inventory(inventory) do |target|
vars = target['vars']
roles = [(vars['role'] || vars['roles'])].flatten
roles = [vars['role'] || vars['roles']].flatten
roles = roles.map(&:downcase)
output_collector << target['uri'] if roles.include? role.downcase
end
Expand Down
11 changes: 4 additions & 7 deletions lib/puppet_litmus/rake_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,9 @@
inventory_vars = provision_hash[key]['vars']
# Splat the params into environment variables to pass to the provision task but only in this runspace
provision_hash[key]['params']&.each { |k, value| ENV[k.upcase] = value.to_s }
results = []

provision_hash[key]['images'].each do |image|
results << provision(provisioner, image, inventory_vars)
provision_hash[key]['images'].map do |image|
provision(provisioner, image, inventory_vars)
end
results
end

def tear_down_nodes(targets, inventory_hash)
Expand Down Expand Up @@ -160,11 +157,11 @@
def configure_path(inventory_hash)
results = []
# fix the path on ssh_nodes
unless inventory_hash['groups'].select { |group| group['name'] == 'ssh_nodes' && !group['targets'].empty? }.empty?
unless inventory_hash['groups'].none? { |group| group['name'] == 'ssh_nodes' && !group['targets'].empty? }

Check warning on line 160 in lib/puppet_litmus/rake_helper.rb

View check run for this annotation

Codecov / codecov/patch

lib/puppet_litmus/rake_helper.rb#L160

Added line #L160 was not covered by tests
results << run_command('echo PATH="$PATH:/opt/puppetlabs/puppet/bin" > /etc/environment',
'ssh_nodes', config: nil, inventory: inventory_hash)
end
unless inventory_hash['groups'].select { |group| group['name'] == 'winrm_nodes' && !group['targets'].empty? }.empty?
unless inventory_hash['groups'].none? { |group| group['name'] == 'winrm_nodes' && !group['targets'].empty? }

Check warning on line 164 in lib/puppet_litmus/rake_helper.rb

View check run for this annotation

Codecov / codecov/patch

lib/puppet_litmus/rake_helper.rb#L164

Added line #L164 was not covered by tests
results << run_command('[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Puppet Labs\Puppet\bin;C:\Program Files (x86)\Puppet Labs\Puppet\bin", "Machine")',
'winrm_nodes', config: nil, inventory: inventory_hash)
end
Expand Down
2 changes: 1 addition & 1 deletion puppet_litmus.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
spec.summary = 'Providing a simple command line tool for puppet content creators, to enable simple and complex test deployments.'
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
spec.add_runtime_dependency 'bolt', '~> 3.0'
spec.add_runtime_dependency 'docker-api', '>= 1.34', '< 3.0.0'
spec.add_runtime_dependency 'docker-api', '>= 1.34', '< 3.0.0'
spec.add_runtime_dependency 'parallel'
spec.add_runtime_dependency 'puppet-modulebuilder', '>= 0.3.0'
spec.add_runtime_dependency 'retryable', '~> 3.0'
Expand Down