-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to work with Ruby 2.4.0 #13104
Changes from all commits
90c1d06
ef992a1
ff9b467
56f5fc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
|
||
expect(FileUtils).to receive(:mkdir_p).with("/repo/mirror") | ||
expect(MiqApache::Conf).to receive(:create_conf_file).once.and_return(true) | ||
expect(FileUtils).to receive(:rm).with("/etc/httpd/conf.d/manageiq-https-mirror.conf", :force => true) | ||
expect(FileUtils).to receive(:rm).with("/etc/httpd/conf.d/manageiq-https-mirror.conf", hash_including(:force => true)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See commit, it's basically changed from an options hash to kwargs so the expectations on arguments is different now. |
||
expect(MiqApache::Control).to receive(:restart).once | ||
expect(LinuxAdmin::Yum).to receive(:download_packages).once.with("/repo/mirror", "cfme-appliance") | ||
expect(Dir).to receive(:glob).with("/repo/mirror/**/*.rpm").and_return(rpm_file_list) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Ruby 2.4.0 removed the closed? check in the conditional in: s.close if !s.closed? | ||
# Webmock was changed to add close to StubSocket along with another change. | ||
# https://github.com/ruby/ruby/commit/f845a9ef76c0195254ded79c85c24332534f4057 | ||
# https://github.com/bblimke/webmock/commit/8f2176a1fa75374df55b87d782e08ded673a75b4 | ||
# WebMock 2.3.1+ fixed this. | ||
# We should upgrade webmock but that requires some re-recording of cassettes (I think) | ||
# and maybe other things. | ||
if WebMock::VERSION < "2.3.1" | ||
class StubSocket | ||
def close | ||
end | ||
end | ||
else | ||
warn "Remove me: #{__FILE__}:#{__LINE__}. WebMock 2.3.1+ fixed the issue with ruby 2.4.0 by adding StubSocket#close." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a reminder in case we upgrade webmock and forget to remove this monkey patch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you weren't tempted to upgrade webmock? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was. I have no idea how to re-record all of the cassettes though. #14270 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, also, re-recording cassettes is a major bloat on a repo if everything is replaced completely. Might be better if we can figure out how to just update the yaml of the cassettes in a programmatic fashion with the needed changes for webmock to avoid needing to actually re-record the cassettes. |
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be safe @cben, others, I kept this test but made it return what ruby 2.4.0 is expecting. We'll have to address this as we move to ruby 2.4.0 more. This should be enough to get us compatible for now.