opensearch-sdk-java icon indicating copy to clipboard operation
opensearch-sdk-java copied to clipboard

[FEATURE] Add support for sample extension(s) to run integration tests

Open dbwiddis opened this issue 3 years ago • 0 comments

Is your feature request related to a problem?

Unit testing is unable to handle end-to-end "how does an extension respond to a REST request from OpenSearch". When writing "hello world" I relied on manually starting up the nodes and running the test myself.

As we expect developers to write new extensions we should make it as easy as possible for them to write REST integration tests ensuring OpenSearch REST requests interact appropriately with their Extension code.

What solution would you like?

The Anomaly Detector plugin's org.opensearch.ad.rest package has some REST ITs that would make good models. That's the easy part. There are a few calls to util functions that need to be evaluated in an extension context.

What alternatives have you considered?

Doing testing manually. This is not scalable, and more importantly, wouldn't help developers developing new extensions.

Do you have any additional context?

Need to also go through the request/response code already being used and ensure it's fully covered by unit tests.

dbwiddis avatar Sep 01 '22 07:09 dbwiddis