-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Factor groovy out of core into lang-groovy #13834
Conversation
@@ -758,7 +757,7 @@ public void testIds() { | |||
ids.put(92, org.elasticsearch.indices.recovery.DelayRecoveryException.class); | |||
ids.put(93, org.elasticsearch.search.warmer.IndexWarmerMissingException.class); | |||
ids.put(94, org.elasticsearch.client.transport.NoNodeAvailableException.class); | |||
ids.put(95, org.elasticsearch.script.groovy.GroovyScriptCompilationException.class); | |||
ids.put(95, null); |
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.
Should this really be null?
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.
Yes, see the note in ElasticsearchException. numbers should never be removed, only assigned to null if the exception is removed.
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.
Got it. Thanks.
LGTM. Glad to see this moved to a plugin. |
+1 on moving the tests into the plugin - We can gracefully move them back or to unittests while we go.. I think we should just open a issue that we have to do that so we don't forget! Thanks for working on this! |
Factor groovy out of core into lang-groovy
I just backported this to 2.x |
groovy moved to a plugin but the tests rely on it see elastic#13834
groovy moved to a plugin but the tests rely on it see #13834
This commit moves back some messy tests that have been placed in lang-groovy module in elastic#13834. It removes the dependency on Groovy plugin as well as change back the tests to integration tests (IT suffix). It also changes the current MockScriptEngine and MockScriptPlugin to make it easier to use.
After elastic#13834 many tests that used Groovy scripts (for good or bad reason) in their tests have been moved in the lang-groovy module and the issue elastic#13837 has been created to track these messy tests in order to clean them up. This commit moves more tests back in core, removes the dependency on Groovy, changes the scripts in order to use the mocked script engine, and change the tests to integration tests.
After elastic#13834 many tests that used Groovy scripts (for good or bad reason) in their tests have been moved in the lang-groovy module and the issue elastic#13837 has been created to track these messy tests in order to clean them up. This commit moves more tests back in core, removes the dependency on Groovy, changes the scripts in order to use the mocked script engine, and change the tests to integration tests.
After elastic#13834 many tests that used Groovy scripts (for good or bad reason) in their tests have been moved in the lang-groovy module and the issue elastic#13837 has been created to track these messy tests in order to clean them up. The work started with elastic#19280, elastic#19302 and elastic#19336 and this PR moves the remaining messy tests back in core, removes the dependency on Groovy, changes the scripts in order to use the mocked script engine, and change the tests to integration tests. It also moves IndexLookupIT test back (even if it has good chance to be removed soon) and fixes its tests. It also changes AbstractQueryTestCase to use custom script plugins in tests. closes elastic#13837
This commit moves back some messy tests that have been placed in lang-groovy module in elastic/elasticsearch#13834. It removes the dependency on Groovy plugin as well as change back the tests to integration tests (IT suffix). It also changes the current MockScriptEngine and MockScriptPlugin to make it easier to use.
See #13725 for the motivation.
Note that many core tests (approximately 50) depend on groovy. Rather than try to refactor all of these at once, I simply moved them all to this plugin under the
org.elasticsearch.messy.tests
package, so we can deal with them iteratively. This preserves them in their entirety, so we don't lose coverage, or go back and forth on how each one should be fixed: instead this way we can clean up over time.Last time when factoring out expressions, @rjernst stayed up all night to fix a bunch of tests, but we can't do things this way, that is why I did what I did.
The package-info.java has guidelines about what I think we should do, to get them back in core. It also has the list of renames so you know where each file came from (in case its easy to fix and move back to core).
I made no security changes here to not bury in this noise.