Jira (PUP-11406) Add Ruby 3.1

7 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Jan 5, 2022, 12:20:03 PM1/5/22
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Bug PUP-11406
Add Ruby 3.1
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2022/01/05 9:19 AM
Priority: Normal Normal
Reporter: Josh Cooper

Puppet rspec tests currently fail on Ruby 3.1:

rspec ./spec/unit/reports/store_spec.rb:23 # Puppet::Reports::Store#process should create a report directory for the client if one doesn't exist
rspec ./spec/unit/reports/store_spec.rb:29 # Puppet::Reports::Store#process should write the report to the file in YAML
rspec ./spec/unit/reports/store_spec.rb:36 # Puppet::Reports::Store#process rejects invalid hostnames
rspec ./spec/unit/util/storage_spec.rb:170 # Puppet::Util::Storage when loading from the state file when the state file/directory exists should load Time and Symbols
rspec ./spec/unit/network/formats_spec.rb:506 # Puppet Network Format :console format when rendering face-related objects pretty prints facts
rspec ./spec/unit/x509/cert_provider_spec.rb:127 # Puppet::X509::CertProvider when loading crls and input is invalid raises when invalid input is inside BEGIN-END block
rspec ./spec/unit/http/service/compiler_spec.rb:591 # Puppet::HTTP::Service::Compiler when putting facts raises a serialization error if the report cannot be serialized

The failures can be grouped into a few different buckets:

1. Ruby 3.1 vendors Psych 4.0, which changed YAML.load to behave like YAML.safe_load. To get the unsafe behavior you have to call YAML.unsafe_load explicitly, which our tests are relying on to load an old report format.

2. Ruby 3.1 no longer accepts certain Time strings:

  1) Puppet Network Format :console format when rendering face-related objects pretty prints facts
     Failure/Error: tm = Time.new("2016-01-27T19:30:00")
     ArgumentError:
       invalid value for Integer(): "2016-01-27T19:30:00"

3. Ruby 3.1 changed the error messages associated with some openssl and string encoding errors, e.g.

 expected OpenSSL::X509::CRLError with "nested asn1 error", got #<OpenSSL::X509::CRLError: PEM_read_bio_X509_CRL: bad base64 decode>
 
expected Puppet::HTTP::SerializationError with message matching /Failed to serialize Puppet::Node::Facts to json: "\\xE2" from ASCII-8BIT to UTF-8/, got #<Puppet::HTTP::SerializationError: Failed to serialize Puppet::Node::Facts to json: partial character in source, but hit end

Once the failures are resolved, add Ruby 3.1 in GH actions for Ubuntu (and Windows if it's available)

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Jan 13, 2022, 9:02:01 PM1/13/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Phoenix

Lisa Ross (Jira)

unread,
Feb 23, 2022, 12:09:02 PM2/23/22
to puppe...@googlegroups.com
Lisa Ross updated an issue
Change By: Lisa Ross
Sprint: Phoenix 2022-03-16

Lisa Ross (Jira)

unread,
Feb 23, 2022, 1:06:04 PM2/23/22
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages