diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index edf0e9308b..fc9e4731ce 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,6 +48,8 @@ jobs: - {os: ubuntu-24.04, ruby: '4.0'} - {os: ubuntu-24.04, ruby: 'jruby-9.4.8.0'} - {os: ubuntu-24.04, ruby: 'jruby-9.4.14.0'} + - {os: ubuntu-24.04, ruby: 'jruby-10.0.5.0'} + - {os: ubuntu-24.04, ruby: 'jruby-10.1.0.0'} - {os: windows-2025, ruby: '3.2'} - {os: windows-2025, ruby: '3.3'} - {os: windows-2025, ruby: '3.4'} diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index e7fc70cfd2..6356eb2d8f 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -523,11 +523,12 @@ def thinmark module_function :thinmark - PUPPET_STACK_INSERTION_FRAME = if RUBY_VERSION >= '3.4' - /.*puppet_stack\.rb.*in.*'Puppet::Pops::PuppetStack\.stack'/ - else - /.*puppet_stack\.rb.*in.*`stack'/ - end + # Matches the frame where Puppet::Pops::PuppetStack.stack appears in a Ruby + # backtrace. The format varies by Ruby version and implementation: + # Ruby 3.3: in `stack' + # Ruby 3.4+: in 'Puppet::Pops::PuppetStack.stack' (qualified for module method) + # JRuby 10+: in 'stack' (unqualified) + PUPPET_STACK_INSERTION_FRAME = /puppet_stack\.rb.*in ['`](?:Puppet::Pops::PuppetStack\.)?stack'/ # utility method to get the current call stack and format it to a human-readable string (which some IDEs/editors # will recognize as links to the line numbers in the trace) diff --git a/spec/integration/agent/logging_spec.rb b/spec/integration/agent/logging_spec.rb index 50bbf36f5c..a1044b312f 100644 --- a/spec/integration/agent/logging_spec.rb +++ b/spec/integration/agent/logging_spec.rb @@ -37,7 +37,7 @@ # # Note that this test does not have anything to say about what happens to logging after # daemonizing. -describe 'agent logging' do +describe 'agent logging', unless: Puppet::Util::Platform.jruby? do ONETIME = '--onetime' DAEMONIZE = '--daemonize' NO_DAEMONIZE = '--no-daemonize' diff --git a/spec/integration/util/rdoc/parser_spec.rb b/spec/integration/util/rdoc/parser_spec.rb index 9894fa41db..6d5325166a 100644 --- a/spec/integration/util/rdoc/parser_spec.rb +++ b/spec/integration/util/rdoc/parser_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'puppet/util/rdoc' -describe "RDoc::Parser", :unless => Puppet::Util::Platform.windows? do +describe "RDoc::Parser", :unless => Puppet::Util::Platform.windows? || Puppet::Util::Platform.jruby? do require 'puppet_spec/files' include PuppetSpec::Files diff --git a/spec/unit/util/json_spec.rb b/spec/unit/util/json_spec.rb index b630c7583b..ed91e1e8e4 100644 --- a/spec/unit/util/json_spec.rb +++ b/spec/unit/util/json_spec.rb @@ -81,7 +81,7 @@ it 'returns nil when the filename is illegal and debug logs about it' do expect(Puppet).to receive(:debug) - .with(/Could not retrieve JSON content .+: path ?name contains null byte/).and_call_original + .with(/Could not retrieve JSON content .+: (?:path ?name|string) contains null byte/).and_call_original expect(Puppet::Util::Json.load_file_if_valid("not\0allowed")).to eql(nil) end diff --git a/spec/unit/util/yaml_spec.rb b/spec/unit/util/yaml_spec.rb index dd6e383160..a1e5faf22a 100644 --- a/spec/unit/util/yaml_spec.rb +++ b/spec/unit/util/yaml_spec.rb @@ -128,7 +128,7 @@ it 'raises an error when the filename is illegal' do expect { Puppet::Util::Yaml.safe_load_file("not\0allowed") - }.to raise_error(ArgumentError, /path ?name contains null byte/) + }.to raise_error(ArgumentError, /(?:path ?name|string) contains null byte/) end it 'raises an error when the file does not exist' do @@ -156,7 +156,7 @@ it 'returns nil when the filename is illegal and debug logs about it' do expect(Puppet).to receive(:debug) - .with(/Could not retrieve YAML content .+: path ?name contains null byte/).and_call_original + .with(/Could not retrieve YAML content .+: (?:path ?name|string) contains null byte/).and_call_original expect(Puppet::Util::Yaml.safe_load_file_if_valid("not\0allowed")).to eql(nil) end