Skip to content

[TEST] Move back some messy tests from Groovy plugin to core#19280

Merged
tlrx merged 1 commit intoelastic:masterfrom
tlrx:clean-up-some-messy-tests
Jul 7, 2016
Merged

[TEST] Move back some messy tests from Groovy plugin to core#19280
tlrx merged 1 commit intoelastic:masterfrom
tlrx:clean-up-some-messy-tests

Conversation

@tlrx
Copy link
Copy Markdown
Member

@tlrx tlrx commented Jul 6, 2016

After #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 #13837 has been created to track these messy tests in order to clean them up.

This PR moves BucketSelectorIT, BucketScriptIT, HDRPercentileRanksIT and HDRPercentilesIT back at their original place in core, removes the dependency on Groovy, changes the scripts in order to use the mocked script engine MockScriptEngine instead, and change them back to integration tests.

This PR also changes MockScriptEngine and MockScriptPlugin so that it is easier, I hope, to mock scripts.

@tlrx tlrx added >test Issues or PRs that are addressing/adding tests review :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v5.0.0-alpha5 labels Jul 6, 2016
@tlrx tlrx changed the title Remove Groovy from some messy tests [TEST] Move back some messy tests from Groovy plugin to core Jul 6, 2016
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels weird to default here. Maybe just let the NPE bubble up?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree, I just forgot to change that.

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Jul 6, 2016

I left a few comments. I love the idea of using a script-looking implementation as the id of the script.

I think I'd prefer if the custom scripts used for aggregations were shared. I see that not all of them are shared, but the ones that are it'd be nice if they were in a top level class in an appropriate package. Mostly because I think those implementations might drift apart over time and while they are the same now they'll change and we'll have subtle bugs you can only find by comparing two nearly identical chunks of code.

@tlrx
Copy link
Copy Markdown
Member Author

tlrx commented Jul 6, 2016

@nik9000 Thanks for your review! I updated the code, can you please have another look?

I think I'd prefer if the custom scripts used for aggregations were shared. I see that not all of them are shared, but the ones that are it'd be nice if they were in a top level class in an appropriate package. Mostly because I think those implementations might drift apart over time and while they are the same now they'll change and we'll have subtle bugs you can only find by comparing two nearly identical chunks of code.

I agree too, let's do that.

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Jul 6, 2016

LGTM

@tlrx tlrx force-pushed the clean-up-some-messy-tests branch from 2d1c818 to dc8b202 Compare July 7, 2016 12:05
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.
@tlrx tlrx force-pushed the clean-up-some-messy-tests branch from dc8b202 to b58f2eb Compare July 7, 2016 13:26
@tlrx tlrx merged commit b58f2eb into elastic:master Jul 7, 2016
@tlrx tlrx removed the review label Jul 7, 2016
@tlrx
Copy link
Copy Markdown
Member Author

tlrx commented Jul 7, 2016

Thanks @nik9000 !

@tlrx tlrx deleted the clean-up-some-messy-tests branch July 7, 2016 13:29
tlrx added a commit to tlrx/elasticsearch that referenced this pull request Aug 1, 2016
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >test Issues or PRs that are addressing/adding tests v5.0.0-alpha5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants