Skip to content

Commit

Permalink
Merge pull request #570 from puppetlabs/revert-565-maint_exclude_rubo…
Browse files Browse the repository at this point in the history
…cop_versions

Revert "(maint) Exclude breaking rubocop versions"
  • Loading branch information
david22swan authored Jun 20, 2024
2 parents a16cc96 + d1f606e commit c0f2e80
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
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 @@ module PuppetLitmus::InventoryManipulation
# @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?
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 @@ def nodes_with_role(role, inventory)
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 @@ def provision_list(provision_hash, key)
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 install_agent(collection, targets, inventory_hash)
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? }
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? }
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

0 comments on commit c0f2e80

Please sign in to comment.