-
Notifications
You must be signed in to change notification settings - Fork 798
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
Satisfy all tests on 8.x branch #1075
base: 8.x
Are you sure you want to change the base?
Conversation
This reverts commit 07482cb.
The goal of ClassMethodsProxy is to avoid polluting the target's namespace, but it was possible to do this by accident when calling `class_eval` before ActiveSupport was completely loaded. This test ensures the namespace isn't polluted, regardless of the load state of ActiveSupport.
ActiveSupport patches Kernel to add `class_eval` but this behavior wasn't loaded in the test environment. This created a discrepancy between test and prod, causing tests to fail that should have passed and vice versa. Fully loading ActiveSupport makes the test environment more accurate.
Actually, the problem was more subtle. When the tests were failing, changing from It turns out the call to In the real application, on the other hand, ActiveSupport defines So the solution was to revert the previous commit, changing Although this was technically all that was needed, I decided to also add a test case to check that the adapter's Ironically, this also means no actual business logic change was needed at all, as the test failures were entirely due to the test environment. |
@sinisterchipmunk this is great work, thank you very much. Great find on the |
I found this conversation ( #1056 ) which led me to the unreleased 8.x branch, but the tests are currently failing.
This pull request makes as few changes as possible in order to make all unit tests pass when running
rake test:all
from the project root.The first commit makes some changes that I found necessary in order to connect to Elasticsearch 8.13.2 running in Docker on my local machine. It...
CERT_DIR
. Since I'm not sure of the history of this constant, I decided to check if it is available usingdefined?(CERT_DIR)
and then only omit the option if the constant is not found, using it as before if it exists.The second commit actually fixes the tests. There was only one logic change needed.
ClassMethodsProxy
needed to useextend
on the adapter methods, rather thaninclude
. Reverted: see comment, belowI hope that with passing tests we may see a formal 8.x release soon. I am not clear on what else needs to be done but am available to contribute more if needed.