Hi Ivan and others,
I would like to discuss what I am doing, and need help regarding it.
We have two components - App (Jersey client) and Data (Elasticsearch)
We used to have Couchbase as a data component but we are migrating to elasticsearch.
In the App component, we serve data from elasticsearch.
I need to write tests on the App layer so that we conform to some standards.
I was trying to use Elasticsearch test framework (ESIntegTestCase). But it had lot of dependency issues.
Basically jar hell was creating problem and logger also.
As you guys are not supporting embedded elasticsearch instance.
And, the documentation is pointing me to use ESIntegTestCase
I was in trouble since I wasn't able to integrate it my test due to issues mentioned above.
In this issue, nik9000 has mentioned that it is better to spin new instance rather than using ESIntegTestCase,
Alecojacoru elasticsearch maven plugin servers this purpose. But I wanted to use it in gradle project. I wasnt able to find any alternative for it.
There are no SLAs on responses to questions posted on this forum, if you require help with an SLA on responses you should look into purchasing a subscription package that includes support with an SLA such as those offered by Elastic.
At this point, I seriously doubt anyone will answer your question. Elastic
support staff do not know anything about internals. Your only hope is for a
developer to chime in, but they are rarely here. The code is open source,
your best option is to dig in. Given the dependency issues, starting your
own instance is the only way to go.
@Ivan This is not how support is working. When someone in the support team does not know an answer, they are asking for help from the dev team. And there are SLAs.
Here we are all doing our best to answer. Some answers are easy. Some other can take more time.
And regarding the problem, I can't answer myself:
I'm not using Gradle apart for plugins in which case the infra available in elasticsearch repo is fine
I'm using most of the time Maven and in that case I used 3 strategies so far which I already shared (I think) with @prakharjain17:
Because of my lack of knowledge so far on Gradle, I pinged in another thread @nik9000 and @rjernst who might have time to answer but again there is no SLA on this forum and it could take time for people to answer.
As has been pointed out, the gradle elasticsearch.esplugin plugin is meant to develop a plugin. However, you can create an integTest task in your project which will launch an elasticsearch instance, and run REST tests. Try applying the elasticsearch.standalone-rest-test and elasticsearch.rest-test plugins. See projects under the qa dir in elasticsearch for examples.
With the elasticsearch plugins, wouldn't the dependencies get pulled in? At
least in the test configuration. Was going to test it out
myself. ESIntegTestCase still works for me whenever I do not have
dependency conflicts (always Lucene).
Let's face it, if it weren't for Ryan, none of these types of questions, at
least mine, will ever be answered. Thanks Ryan!
@Ivan By "elasticsearch plugins" do you mean applying elasticsearch.esplugin? If so, then yes, you get an integTest automatically by using that. But you can also create a rest test (ie tasks for starting an ES cluster and test task to run the REST test runner) directly in a project. This is how many projects under the qa directory in elasticsearch work.
@prakharjain17 I am not talking about ESTestCase or ESIntegTestCase. What I suggested would allow you to start a real elasticsearch node, and create REST tests against it (this are the high level tests we use to check the elasticsearch apis). You can also create a test in java to connect the cluster. Look at the client qa test. That particular test uses the transport client, but you could replace the example dependency there with the rest client if that is what you are using.
its getting compiled for this gradle file, but I need to apply the plugin java. Once I have built the gradle file. How to use elasticsearch instance from my code i.e. how to get client from it or else hostname and port.
Hi dadoodnet,
I have already built this kind of sample project myself.
The problem is integrating the test framework in your own project.
It creates jar hell problem and logger problem.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.