-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add resolv-replace
compatibility test
#998
base: main
Are you sure you want to change the base?
Add resolv-replace
compatibility test
#998
Conversation
9fc690a
to
09dea6d
Compare
While `dalli` doesn't depend on `resolv-replace`, we want to ensure it still works if it is required by the host application. This regression test ensures we don't break compatibility, and adds a framework allowing us to test compatibility with other gems in the future.
09dea6d
to
610a4b9
Compare
# JRuby does not support forking, and it doesn't seem worth the effort to make it work. | ||
return unless Process.respond_to?(:fork) |
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.
Active Support has some workarounds for this we could use, but it doesn't seem worth it for a code path that was previously untested, and is unlikely to behave differently on JRuby.
].each do |gem_name| | ||
it "passes smoke test with #{gem_name.inspect} gem required" do | ||
memcached(:binary, rand(21_397..21_896)) do |_, port| | ||
in_isolation(timeout: 10) do |
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.
We want to be able to require the gem in isolation so as not to affect the host process and other tests.
assert_equal(expected, client.get(key), message) | ||
end | ||
|
||
def in_isolation(timeout:) # rubocop:disable Metrics |
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.
This method triggers several offences in the Metrics
department, but I don't know that splitting it would be an improvement.
While
dalli
doesn't depend onresolv-replace
, we want to ensure it still works if it is required by the host application. (#989)This regression test ensures we don't break compatibility, and adds a framework allowing us to test compatibility with other gems in the future.