diff --git a/.travis.yml b/.travis.yml index b74858f71..62c6dffec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,19 +20,18 @@ before_install: cache: bundler jobs: include: - - rvm: 2.4.3 + - rvm: 2.5 env: CHECK=rubocop - # Make sure that the we still work with an older Bundler version - - rvm: 2.4.3 - env: CHECK=acceptance:smoke BUNDLER_VERSION=2.0.2 - - rvm: 2.4.3 + - rvm: 2.5 + env: CHECK=acceptance:smoke + - rvm: 2.5 env: CHECK=acceptance:local_parallel - - rvm: 2.4.3 + - rvm: 2.5 env: CHECK=spec:coverage - - rvm: 2.4.3 + - rvm: 2.5 env: CHECK=license_finder bundler_args: "--with development" # license_finder requires all gems installed. Also can't use an empty string so just include any bundler group - - rvm: 2.5 + - rvm: 2.4 env: CHECK=spec - rvm: 2.3 env: CHECK=spec diff --git a/appveyor.yml b/appveyor.yml index 3cd5eecbd..1e5dbadd3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,11 +9,11 @@ environment: # USE_MSYS: true # SUITES: "spec" # BUNDLE_JOBS: 4 - - RUBY_VERSION: 24-x64 + - RUBY_VERSION: 25-x64 USE_MSYS: true SUITES: "acceptance:smoke" BUNDLE_JOBS: 4 - - RUBY_VERSION: 24-x64 + - RUBY_VERSION: 25-x64 USE_MSYS: true SUITES: "acceptance:local_parallel" BUNDLE_JOBS: 4 diff --git a/lib/pdk/module/metadata.rb b/lib/pdk/module/metadata.rb index 7204a289b..d9cdb3806 100644 --- a/lib/pdk/module/metadata.rb +++ b/lib/pdk/module/metadata.rb @@ -77,7 +77,7 @@ class Metadata OPERATING_SYSTEMS[os_name] }.flatten, 'requirements' => [ - { 'name' => 'puppet', 'version_requirement' => '>= 4.10.0 < 7.0.0' }, + { 'name' => 'puppet', 'version_requirement' => '>= 4.10.0 < 8.0.0' }, ], }.freeze diff --git a/lib/pdk/util/puppet_version.rb b/lib/pdk/util/puppet_version.rb index 0c8014d43..4954e98ac 100644 --- a/lib/pdk/util/puppet_version.rb +++ b/lib/pdk/util/puppet_version.rb @@ -17,7 +17,7 @@ def instance PE_VERSIONS_URL = 'https://forgeapi.puppet.com/private/versions/pe'.freeze DEFAULT_PUPPET_DEV_URL = 'https://github.com/puppetlabs/puppet'.freeze - DEFAULT_PUPPET_DEV_BRANCH = 'master'.freeze + DEFAULT_PUPPET_DEV_BRANCH = 'main'.freeze def puppet_dev_env require 'pdk/util/ruby_version' @@ -80,7 +80,7 @@ def fetch_puppet_dev(options = {}) end # Reset local repo to latest - reset_result = PDK::Util::Git.git('-C', puppet_dev_path, 'reset', '--hard', 'origin/master') + reset_result = PDK::Util::Git.git('-C', puppet_dev_path, 'reset', '--hard', "origin/#{DEFAULT_PUPPET_DEV_BRANCH}") @puppet_dev_fetched = true return if reset_result[:exit_code].zero? diff --git a/package-testing/Rakefile b/package-testing/Rakefile index 989e6f511..7fa73226f 100644 --- a/package-testing/Rakefile +++ b/package-testing/Rakefile @@ -69,7 +69,6 @@ namespace :acceptance do puts "Generating beaker hosts using TEST_TARGET value #{test_target}" - cli = BeakerHostGenerator::CLI.new(["#{test_target}{type=foss}", '--disable-default-role', '--hypervisor', 'abs']) File.open('acceptance_hosts.yml', 'w') do |hosts_file| diff --git a/package-testing/config/options.rb b/package-testing/config/options.rb index 001e252b1..d4910c7c6 100644 --- a/package-testing/config/options.rb +++ b/package-testing/config/options.rb @@ -3,5 +3,5 @@ keys: ['~/.ssh/id_rsa-acceptance'], }, preserve_hosts: 'onfail', - provision: 'true' + provision: 'true', } diff --git a/spec/acceptance/validate_ruby_spec.rb b/spec/acceptance/validate_ruby_spec.rb index 4adc33f83..ef3a633d9 100644 --- a/spec/acceptance/validate_ruby_spec.rb +++ b/spec/acceptance/validate_ruby_spec.rb @@ -11,6 +11,7 @@ before(:all) do File.open(spec_violation_rb, 'w') do |f| + f.puts "# frozen_string_literal: true\n\n" f.puts 'f = %(x y z)' end end @@ -41,6 +42,7 @@ before(:all) do FileUtils.mkdir_p(File.dirname(another_violation_rb)) File.open(another_violation_rb, 'w') do |f| + f.puts "# frozen_string_literal: true\n\n" f.puts "puts {:foo => 'bar'}.inspect" end end @@ -87,6 +89,7 @@ context 'when auto-correcting violations' do before(:all) do File.open('test.rb', 'w') do |f| + f.puts "# frozen_string_literal: true\n\n" f.puts "puts({'a' => 'b'}.inspect)" end end @@ -111,6 +114,7 @@ FileUtils.mkdir_p(File.join('spec', 'unit')) (1..5000).each do |num| File.open(File.join('spec', 'unit', "test#{num}.rb"), 'w') do |f| + f.puts "# frozen_string_literal: true\n\n" f.puts "puts({ 'a' => 'b' }.inspect)" end end diff --git a/spec/unit/pdk/util/puppet_version_spec.rb b/spec/unit/pdk/util/puppet_version_spec.rb index 73911515c..06e5df6d5 100644 --- a/spec/unit/pdk/util/puppet_version_spec.rb +++ b/spec/unit/pdk/util/puppet_version_spec.rb @@ -211,7 +211,7 @@ before(:each) do allow(PDK::Util).to receive(:cachedir).and_return('/path/to/') allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'fetch', 'origin').and_return(fetch_results) - allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'reset', '--hard', 'origin/master').and_return(exit_code: 0) + allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'reset', '--hard', 'origin/main').and_return(exit_code: 0) end it 'exits cleanly' do @@ -231,7 +231,7 @@ before(:each) do allow(PDK::Util).to receive(:cachedir).and_return('/path/to/') allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'fetch', 'origin').and_return(exit_code: 0) - allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'reset', '--hard', 'origin/master').and_return(reset_results) + allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'reset', '--hard', 'origin/main').and_return(reset_results) end it 'raises an error' do @@ -255,7 +255,7 @@ before(:each) do allow(PDK::Util).to receive(:cachedir).and_return('/path/to/') allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'fetch', 'origin').and_return(exit_code: 0) - allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'reset', '--hard', 'origin/master').and_return(reset_results) + allow(PDK::Util::Git).to receive(:git).with('-C', anything, 'reset', '--hard', 'origin/main').and_return(reset_results) end it 'exits cleanly' do @@ -555,8 +555,8 @@ def result(pe_version) let(:metadata) { PDK::Module::Metadata.new } context 'with default metadata' do - it 'searches for a Puppet gem >= 4.10.0 < 7.0.0' do - requirement = Gem::Requirement.create(['>= 4.10.0', '< 7.0.0']) + it 'searches for a Puppet gem >= 4.10.0 < 8.0.0' do + requirement = Gem::Requirement.create(['>= 4.10.0', '< 8.0.0']) expect(described_class.instance).to receive(:find_gem).with(requirement) described_class.from_module_metadata(metadata)