-
Notifications
You must be signed in to change notification settings - Fork 50
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
Backwards compatibility tests for async search #95
Conversation
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #95 +/- ##
=======================================
Coverage ? 83.38%
Complexity ? 554
=======================================
Files ? 61
Lines ? 2058
Branches ? 146
=======================================
Hits ? 1716
Misses ? 236
Partials ? 106 Continue to review full report at Codecov.
|
b9d346b
to
0cb3348
Compare
0cb3348
to
e8151ca
Compare
README.md
Outdated
@@ -73,7 +73,10 @@ The project in this package uses the [Gradle](https://docs.gradle.org/current/us | |||
5. `./gradlew integTest -PnumNodes=3` launches a multi-node cluster with the asynchronous search plugin installed and runs all integ tests. | |||
6. `./gradlew integTest -Dtests.class=*AsynchronousSearchRestIT` runs a single integ class | |||
7. `./gradlew integTest -Dtests.class=*AsynchronousSearchRestIT -Dtests.method="testSubmitWithRetainedResponse"` runs a single integ test method (remember to quote the test method name if it contains spaces) | |||
|
|||
8. `./gradlew asynSearchCluster#mixedClusterTask -Dtests.security.manager=false` launches a cluster of three nodes of bwc version of OpenSearch with async search plugin and tests backwards compatibility by performing rolling upgrade of each node with the current version of OpenSearch with async search plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8. mixedClusterTask
and 9. rollingUpgradeClusterTask
have the same description?
build.gradle
Outdated
buildscript { | ||
ext { | ||
distribution = 'oss-zip' | ||
opensearch_group = "org.opensearch" | ||
isSnapshot = "true" == System.getProperty("build.snapshot", "true") | ||
opensearch_version = System.getProperty("opensearch.version", "1.3.0-SNAPSHOT") | ||
// 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT | ||
os_as_bwc_version = System.getProperty("bwc.version", "1.13.0.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os_as_bwc_version
sounds confusing. Is this just the opendistro_version
@@ -86,15 +86,29 @@ public void indexDocuments() throws IOException { | |||
client().performRequest(new Request(HttpPost.METHOD_NAME, "/_refresh")); | |||
} | |||
|
|||
AsynchronousSearchResponse executeGetAsynchronousSearch(GetAsynchronousSearchRequest getAsynchronousSearchRequest) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we revert this if it's an unintended indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no the code has changed a bit as i've overloaded this method
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
build.gradle
Outdated
} | ||
systemProperty 'tests.rest.bwcsuite_cluster', 'old_cluster' | ||
systemProperty 'tests.rest.bwcsuite_round', 'old' | ||
systemProperty 'tests.plugin_bwc_version', opendistro_plugin_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this system property being used anywhere. Do you still need this?
List<Map<String, Object>> plugins = (List<Map<String, Object>>) response.get("plugins"); | ||
Set<Object> pluginNames = | ||
plugins.stream().map(map -> map.get("name")).collect(Collectors.toSet()); | ||
switch (CLUSTER_TYPE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this switch case since we are calling testAsyncSearchAndSettingsApi(true)
for all of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i made changes to call with false for upgraded plugin.
case OLD: | ||
case MIXED: | ||
case UPGRADED: | ||
testAsyncSearchAndSettingsApi(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is shouldUseLegacyApi
true even for an upgraded cluster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially wrote with a different case where legacy will be used only for old and mixed. But changed it to check if legacy APIs will work for all 3 cases.
Is there any recommendation for upgraded cluster ? should we use the current APIs for upgraded instead of legacy ?
(Map<String, Map<String, Object>>) getAsMap(uri).get("nodes"); | ||
for (Map<String, Object> response : responseMap.values()) { | ||
List<Map<String, Object>> plugins = (List<Map<String, Object>>) response.get("plugins"); | ||
Set<Object> pluginNames = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we verify the plugins installed for the nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -67,20 +79,42 @@ public static Request buildHttpRequest(SubmitAsynchronousSearchRequest submitAsy | |||
return request; | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you can remove these empty lines.
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for adding this @bharath-techie!
Description
Description of changes:
Issues Resolved
[List any issues this PR will resolve]
#33
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.