Skip to content

Conversation

mhashizume
Copy link
Contributor

In preparation for Puppet 8, which will likely use Ruby 3.2, this commit adds Ruby 3.2.0-preview1 to the rspec test matrix.

@mhashizume mhashizume force-pushed the FACT-3154/main/ruby_3_2 branch 7 times, most recently from 90e3fc1 to 592ed0a Compare October 6, 2022 21:29
@mhashizume
Copy link
Contributor Author

This PR does not add Ruby 3.2.0 preview builds to Windows tests as they are not yet available through the setup-ruby action.

@mhashizume mhashizume marked this pull request as ready for review October 6, 2022 21:36
@mhashizume mhashizume requested a review from a team as a code owner October 6, 2022 21:36
In preparation for Puppet 8, which will likely use Ruby 3.2,
this commit adds Ruby 3.2.0-preview2 to the rspec test matrix.
The File.exists? method was deprecated in Ruby 2.1.0:
https://github.com/ruby/ruby/blob/6d728bdae9de565ad9d0b2fee2d4c2a33c6f4eac/file.c#L1414

And removed entirely from 3.2.0 onward:
https://bugs.ruby-lang.org/issues/17391

This commit updates that method to File.exist? in the directory
loader spec tests.
Prior to this commit, the `mac_from` method would implicitly
return a logging object when rescuing an error when it should
return nil.

This commit updates the method to correctly return nil when
rescuing an error, which fixes some failing tests in Ruby >= 3.2.0.
There is a bug in timecop in how it interacts with newer versions
of Psych that causes our YAML parser date spec to fail.

This commit sets this test as pending until we can find a long-
term resolution.

travisjeffery/timecop#390
@mhashizume mhashizume force-pushed the FACT-3154/main/ruby_3_2 branch from 592ed0a to 2c5e35f Compare October 7, 2022 16:31
@joshcooper joshcooper merged commit 9f5c1db into puppetlabs:main Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants