Jira (PUP-11406) Update tests for Ruby 3.1

30 views
Skip to first unread message

Josh Cooper (Jira)

unread,
May 24, 2022, 4:24:02 PM5/24/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-11406
Update tests for Ruby 3.1
Change By: Josh Cooper
Summary: Add Update tests for Ruby 3.1
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
May 24, 2022, 4:29:03 PM5/24/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-11544

Josh Cooper (Jira)

unread,
Sep 13, 2022, 1:38:02 PM9/13/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP PA - 11544 4664
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Sep 29, 2022, 1:17:02 PM9/29/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2022-10-26

Josh Cooper (Jira)

unread,
Oct 7, 2022, 1:20:02 PM10/7/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Summary: Update tests for Ruby 3. 2 1

Josh Cooper (Jira)

unread,
Oct 7, 2022, 1:21:02 PM10/7/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Puppet rspec tests currently fail on Ruby 3.1:

{noformat}
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
{noformat}

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:

{noformat}
  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"
{noformat}

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

{noformat}
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
{noformat}

4. Fast-gettext is not compatible with Ruby 3.2, because it calls String#untaint and that method was removed. We'll need to bump our dependency on fast-gettext to "~> 2.1", see related ticket PA-4725

Josh Cooper (Jira)

unread,
Oct 7, 2022, 1:23:01 PM10/7/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Acceptance Criteria: It should be possible to run bundle exec rake parallel:spec with ruby 3.1.2

Josh Cooper (Jira)

unread,
Oct 7, 2022, 1:31:02 PM10/7/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Story Points: 3

Aria Li (Jira)

unread,
Oct 10, 2022, 6:48:01 PM10/10/22
to puppe...@googlegroups.com
Aria Li assigned an issue to Aria Li
Change By: Aria Li
Assignee: Aria Li

Aria Li (Jira)

unread,
Oct 11, 2022, 1:29:01 PM10/11/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Sprint: Phoenix 2022-10- 26 12

Josh Cooper (Jira)

unread,
Oct 12, 2022, 11:58:01 AM10/12/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Not Needed

Morgan Rhodes (Jira)

unread,
Oct 12, 2022, 1:25:03 PM10/12/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Sprint: Phoenix 2022-10-12 , Phoenix 2022-10-26

Aria Li (Jira)

unread,
Nov 30, 2022, 6:52:03 PM11/30/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Fix Version/s: PUP 7.21.0

Aria Li (Jira)

unread,
Nov 30, 2022, 7:30:04 PM11/30/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Fix Version/s: PUP 7.21.0
Fix Version/s: PUP 8.0.0

Aria Li (Jira)

unread,
Apr 17, 2023, 5:24:02 PM4/17/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes: Not Needed Enhancement

Aria Li (Jira)

unread,
Apr 18, 2023, 12:22:02 PM4/18/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes: Enhancement Not Needed
Reply all
Reply to author
Forward
0 new messages