Skip to content

Commit 833d1cc

Browse files
committed
Update JRuby in tests to 9.4.8.0
This commit updates the version of JRuby used in spec tests from 9.4.3.0 to 9.4.8.0, which matches what is used in the latest version of Puppet Server 8.x. (See: puppetlabs/jruby-utils@0e23173.) JRuby 9.4.8.0 includes bug fixes to several issues that we have worked around in Puppet in the past: - Dir.glob not properly supporting wildcard syntax (worked around in Puppet in 663062a, resolved in JRuby in jruby/jruby@a39cd49). - format and sprintf not supporting %a and %A (worked around in Puppet in 334ea05, resolved in JRuby in jruby/jruby#7996). Because of these bug fixes in JRuby, this commit also removes Puppet's workarounds.
1 parent b0d63e5 commit 833d1cc

File tree

4 files changed

+2
-12
lines changed

4 files changed

+2
-12
lines changed

.github/workflows/rspec_tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- {os: ubuntu-latest, ruby: '3.1'}
2020
- {os: ubuntu-20.04, ruby: '3.2'} # openssl 1.1.1
2121
- {os: ubuntu-22.04, ruby: '3.2'} # openssl 3
22-
- {os: ubuntu-latest, ruby: 'jruby-9.4.3.0'}
22+
- {os: ubuntu-latest, ruby: 'jruby-9.4.8.0'}
2323
- {os: windows-2019, ruby: '3.1'}
2424
- {os: windows-2019, ruby: '3.2'} # openssl 3
2525

lib/puppet/node/environment.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,7 @@ def perform_initial_import
593593
if file == NO_MANIFEST
594594
empty_parse_result
595595
elsif File.directory?(file)
596-
# JRuby does not properly perform Dir.glob operations with wildcards, (see PUP-11788 and https://github.com/jruby/jruby/issues/7836).
597-
# We sort the results because Dir.glob order is inconsistent in Ruby < 3 (see PUP-10115).
598-
parse_results = Puppet::FileSystem::PathPattern.absolute(File.join(file, '**/*')).glob.select { |globbed_file| globbed_file.end_with?('.pp') }.sort.map do |file_to_parse|
596+
parse_results = Puppet::FileSystem::PathPattern.absolute(File.join(file, '**/*.pp')).glob.map do |file_to_parse|
599597
parser.file = file_to_parse
600598
parser.parse
601599
end

spec/unit/file_system/path_pattern_spec.rb

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'spec_helper'
22
require 'puppet_spec/files'
33
require 'puppet/file_system'
4-
require 'puppet/util'
54

65
describe Puppet::FileSystem::PathPattern do
76
include PuppetSpec::Files
@@ -134,9 +133,6 @@
134133
end
135134

136135
it 'globs wildcard patterns properly' do
137-
# See PUP-11788 and https://github.com/jruby/jruby/issues/7836.
138-
pending 'JRuby does not properly handle Dir.glob' if Puppet::Util::Platform.jruby?
139-
140136
dir = tmpdir('globtest')
141137
create_file_in(dir, 'foo.pp')
142138
create_file_in(dir, 'foo.pp.pp')

spec/unit/pops/types/string_converter_spec.rb

-4
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@
316316
'%.1f' => '18.0',
317317
}.each do |fmt, result |
318318
it "the format #{fmt} produces #{result}" do
319-
pending("PUP-8612 %a and %A not support on JRuby") if RUBY_PLATFORM == 'java' && fmt =~ /^%[aA]$/
320319
string_formats = { Puppet::Pops::Types::PIntegerType::DEFAULT => fmt}
321320
expect(converter.convert(18, string_formats)).to eq(result)
322321
end
@@ -410,7 +409,6 @@
410409
'%#B' => '0B10010',
411410
}.each do |fmt, result |
412411
it "the format #{fmt} produces #{result}" do
413-
pending("PUP-8612 %a and %A not support on JRuby") if RUBY_PLATFORM == 'java' && fmt =~ /^%[-.014]*[aA]$/
414412
string_formats = { Puppet::Pops::Types::PFloatType::DEFAULT => fmt}
415413
expect(converter.convert(18.0, string_formats)).to eq(result)
416414
end
@@ -587,7 +585,6 @@
587585
"%#Y" => 'Y',
588586
}.each do |fmt, result |
589587
it "the format #{fmt} produces #{result}" do
590-
pending("PUP-8612 %a and %A not support on JRuby") if RUBY_PLATFORM == 'java' && fmt =~ /^%[aA]$/
591588
string_formats = { Puppet::Pops::Types::PBooleanType::DEFAULT => fmt}
592589
expect(converter.convert(true, string_formats)).to eq(result)
593590
end
@@ -634,7 +631,6 @@
634631
"%#Y" => 'N',
635632
}.each do |fmt, result |
636633
it "the format #{fmt} produces #{result}" do
637-
pending("PUP-8612 %a and %A not support on JRuby") if RUBY_PLATFORM == 'java' && fmt =~ /^%[aA]$/
638634
string_formats = { Puppet::Pops::Types::PBooleanType::DEFAULT => fmt}
639635
expect(converter.convert(false, string_formats)).to eq(result)
640636
end

0 commit comments

Comments
 (0)