-
Notifications
You must be signed in to change notification settings - Fork 58
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
[FEATURE] Refactor ExtensionsRunner test code out of production source tree #171
Comments
Hi @dbwiddis, |
Great, @roulpriya! Let us know if you have any questions! |
I faced some dependency resolution issue and I appear to have fixed it by making these changes. Does this look good?
|
See the developer guide. You will need to clone the main OpenSearch project, check out the feature/extensions branch, and publish it to Maven local. https://github.com/opensearch-project/opensearch-sdk-java/blob/main/DEVELOPER_GUIDE.md |
Thank you @dbwiddis I am able to set up the project. However, on trying to compile I get this compilation error:
I checked the corresponding source in open-search and perhaps the signature of the function being called here has changed? |
I also have some additional issues with the code. I have opened a draft PR https://github.com/opensearch-project/opensearch-sdk-java/pull/172/files#r990832674 |
I need more of that stack trace. There should be a request or response class associated with that. It's also possible your build.gradle changes are bringing in the wrong dependency. |
Hey @roulpriya just summarizing since I've spread some comments across here and your PR:
Sorry this was a little more complicated than I first thought! Looks like you're making good progress though. |
I think the Looking at this file I don't see any single arg constructor taking a |
Ah, yes, I see that line 57 should also include the unique ID. There was a single arg constructor in #4326, but we apparently broke it in #4598 2 days ago which needed a corresponding change in the SDK. For now just add an empty string argument in TransportActions line 57, and @saratvemulapalli can follow up later to properly add the UniqueID to match his change in #4598. |
Actually, @roulpriya, there is an open PR #164 which should be merged and will fix this issue... sorry you caught us between a Friday and Monday merge of corresponding PRs. |
Now I am able to build and run individual test but running all at once fails because we create a new
I feel we need a corresponding shutdown method as well.
|
Ugh.... so sorry this is more complex than I anticipated!
Sorry for all these complexities! |
Is your feature request related to a problem?
We shouldn't have exclusively test-related code in the main source tree, e.g.,
opensearch-sdk-java/src/main/java/org/opensearch/sdk/ExtensionsRunner.java
Lines 117 to 123 in 8fbcc6e
which calls here, only by tests:
opensearch-sdk-java/src/main/java/org/opensearch/sdk/ExtensionsRunner.java
Lines 159 to 163 in 8fbcc6e
which uses this constant pointing to the test source tree:
opensearch-sdk-java/src/main/java/org/opensearch/sdk/ExtensionSettings.java
Lines 19 to 22 in 8fbcc6e
What solution would you like?
ExtensionsRunner
Extension
argument either package-private (probably) or protected (maybe) so it's accessible by testsExtensionsRunner
in thesrc/test/java
tree to be used as anExtensionsRunner
object when needed for tests, such as the linked comment in the context section below. Move the above code snippets there with modifications as noted below.One would think
TestExtensionsRunner
would be a good name but it's already in use for our test class. Picking a new name will probably be the hardest part. It can extendExtensionsRunner
like so:What alternatives have you considered?
We could use the "sample" extensions for this purpose, or even create a test extension in the sample branch. This seems reasonable for an IT-based approach, but I think this approach is better for unit testing requiring an object with minimal settings.
Do you have any additional context?
The text was updated successfully, but these errors were encountered: