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