Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down
11 changes: 6 additions & 5 deletions lib/puppet/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/agent/logging_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/util/rdoc/parser_spec.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/util/json_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/util/yaml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading