Skip to content

Conversation

@asereda-gs
Copy link
Member

@asereda-gs asereda-gs commented Jun 1, 2018

Allows ES adapter tests to run against real ElasticSearch resource. That instance is started programmatically and embedded in current java process (as part of junit test).

Major benefit of such setup is that there is no dependency on external resource (or process). Integration tests (for this adapter) can now run at build time improving test coverage of the library. Another convenience is that users can define their own indexes and data, validating more edge-cases (like booleans, nested documents unusual attribute names etc.) for this adapter.

This particular PR is a prelude towards aforementioned goal and doesn't contain actual IT tests (which currently fail). They will be corrected and migrated in a separate commit.

@asereda-gs asereda-gs changed the title [CALCITE-2347] running ElasticSearch in embedded mode in unit tests (for ES adapter) [CALCITE-2347] running ElasticSearch embedded mode in unit tests (for ES adapter) Jun 1, 2018
@michaelmior
Copy link
Member

@beikov Can you weigh in on this given your recent work on the ES?

@beikov
Copy link
Contributor

beikov commented Jun 6, 2018

I'm still on vacation so I can only have a deeper look next week. Overall this looks ok though.

@asereda-gs asereda-gs force-pushed the fake-elasticsearch branch 3 times, most recently from be61146 to 69e94dc Compare June 8, 2018 21:01
@asereda-gs asereda-gs force-pushed the fake-elasticsearch branch 2 times, most recently from e5b0506 to f397024 Compare June 19, 2018 01:27
Copy link
Contributor

@beikov beikov left a comment

Choose a reason for hiding this comment

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

Apart from the question regarding the package, this looks good to me.

* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.elasticsearch.node;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intended that this class is in this package rather than in the org.apache.calcite namespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm somehow I though that particular Node constructor is package private (which is not the case) LocalNode has been moved as inner class of EmbeddedNode. No more org.elasticsearch packages.

…of ES adapter (Andrei Sereda)

After discussion on dev-list Integration tests (for ES) have been removed. They're now
superseded by unit tests (which execute queries against a real elastic instance)

Added local file (zips-mini.json) which contains a small subset of original zips.json
(allows to bootstrap tests faster)

Created separate ES JUnit rule which can be re-used across different tests.

Both v2 and v5 of ES adapters are supported.
@asereda-gs asereda-gs force-pushed the fake-elasticsearch branch from f397024 to 4c55691 Compare June 19, 2018 13:24
@asereda-gs
Copy link
Member Author

That package has been removed. LocalNode is inner class in calcite test package (test source).

@beikov
Copy link
Contributor

beikov commented Jun 20, 2018

Looks good to me now. Anything to add @michaelmior ?

@michaelmior
Copy link
Member

Sorry for the delay. Looks good to me as well!

@asfgit asfgit closed this in c12cb4b Jun 21, 2018
snuyanzin pushed a commit to snuyanzin/calcite that referenced this pull request Jun 26, 2018
…of ES adapter (Andrei Sereda)

After discussion on dev-list Integration tests (for ES) have been removed. They're now
superseded by unit tests (which execute queries against a real elastic instance)

Added local file (zips-mini.json) which contains a small subset of original zips.json
(allows to bootstrap tests faster)

Created separate ES JUnit rule which can be re-used across different tests.

Both v2 and v5 of ES adapters are supported.

Close apache#716
wangxlong pushed a commit to wangxlong/calcite that referenced this pull request Feb 13, 2020
…of ES adapter (Andrei Sereda)

After discussion on dev-list Integration tests (for ES) have been removed. They're now
superseded by unit tests (which execute queries against a real elastic instance)

Added local file (zips-mini.json) which contains a small subset of original zips.json
(allows to bootstrap tests faster)

Created separate ES JUnit rule which can be re-used across different tests.

Both v2 and v5 of ES adapters are supported.

Close apache#716
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Aug 28, 2025
…of ES adapter (Andrei Sereda)

After discussion on dev-list Integration tests (for ES) have been removed. They're now
superseded by unit tests (which execute queries against a real elastic instance)

Added local file (zips-mini.json) which contains a small subset of original zips.json
(allows to bootstrap tests faster)

Created separate ES JUnit rule which can be re-used across different tests.

Both v2 and v5 of ES adapters are supported.

Close apache#716

Change-Id: Ia068308cb4a8cd5dc624f5c59c5911e055959ad5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants