Skip to content
Closed
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
15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/module/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/pdk/util/puppet_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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?
Expand Down
1 change: 0 additions & 1 deletion package-testing/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion package-testing/config/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
keys: ['~/.ssh/id_rsa-acceptance'],
},
preserve_hosts: 'onfail',
provision: 'true'
provision: 'true',
}
4 changes: 4 additions & 0 deletions spec/acceptance/validate_ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/pdk/util/puppet_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down