Skip to content

Commit 763216b

Browse files
Merge pull request #9360 from mhashizume/maint/7.x/jruby-dir-glob
Bump to JRuby 9.3.14.0, reenable test
2 parents e1c1b2d + d000aa6 commit 763216b

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

.github/workflows/rspec_tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- {os: ubuntu-latest, ruby: '2.6'}
2121
- {os: ubuntu-latest, ruby: '2.7'}
2222
- {os: ubuntu-latest, ruby: '3.0'}
23-
- {os: ubuntu-latest, ruby: 'jruby-9.3.9.0'}
23+
- {os: ubuntu-latest, ruby: 'jruby-9.3.14.0'}
2424
- {os: windows-2019, ruby: '2.5'}
2525
- {os: windows-2019, ruby: '2.6'}
2626
- {os: windows-2019, ruby: '2.7'}

lib/puppet/node/environment.rb

+4-5
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,11 @@ def perform_initial_import
591591
if file == NO_MANIFEST
592592
empty_parse_result
593593
elsif File.directory?(file)
594-
# JRuby does not properly perform Dir.glob operations with wildcards, (see PUP-11788 and https://github.com/jruby/jruby/issues/7836).
595594
# We sort the results because Dir.glob order is inconsistent in Ruby < 3 (see PUP-10115).
596-
parse_results = Puppet::FileSystem::PathPattern.absolute(File.join(file, '**/*')).glob.select {|globbed_file| globbed_file.end_with?('.pp')}.sort.map do | file_to_parse |
597-
parser.file = file_to_parse
598-
parser.parse
599-
end
595+
parse_results = Puppet::FileSystem::PathPattern.absolute(File.join(file, '**/*.pp')).glob.sort.map do | file_to_parse |
596+
parser.file = file_to_parse
597+
parser.parse
598+
end
600599
# Use a parser type specific merger to concatenate the results
601600
Puppet::Parser::AST::Hostclass.new('', :code => Puppet::Parser::ParserFactory.code_merger.concatenate(parse_results))
602601
else

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')

0 commit comments

Comments
 (0)