Skip to content

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Jain <[email protected]>
  • Loading branch information
vibrantvarun committed Dec 27, 2023
1 parent 6bb2dd3 commit a5d17e1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 37 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/backwards_compatibility_tests_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,8 @@ jobs:
matrix:
java: [ 11, 17, 21 ]
os: [ubuntu-latest,windows-latest]
bwc_version : ["2.11.0"]
bwc_version : ["2.9.0","2.10.0","2.11.0","2.12.0-SNAPSHOT"]
opensearch_version : [ "3.0.0-SNAPSHOT" ]
# exclude:
# - os: windows-latest
# bwc_version: "2.0.1"
# - os: windows-latest
# bwc_version: "2.1.0"
# - os: windows-latest
# bwc_version: "2.2.1"
# - os: windows-latest
# bwc_version: "2.3.0"

name: NeuralSearch Restart-Upgrade BWC Tests
runs-on: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class SemanticSearch extends AbstractRestartUpgradeRestTestCase{
private static final String TEST_FIELD = "passage_text";
private static final String TEXT= "Hello world";

//Test restart-upgrade Semantic Search
//Create Text Embedding Processor, Ingestion Pipeline and add document
//Validate process , pipeline and document count in restart-upgrade scenario
public void testSemanticSearch() throws Exception{
waitForClusterHealthGreen(NODES_BWC_CLUSTER);

Expand Down Expand Up @@ -84,10 +87,5 @@ protected void createPipelineProcessor(String modelId, String pipelineName, Proc
String requestBody=Files.readString(Path.of(classLoader.getResource("processor/PipelineConfiguration.json").toURI()));
createPipelineProcessor(requestBody,pipelineName,modelId);
}

private Map<String, Object> getTotalHits(Map<String, Object> searchResponseAsMap) {
Map<String, Object> hitsMap = (Map<String, Object>) searchResponseAsMap.get("hits");
return (Map<String, Object>) hitsMap.get("total");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class SemanticSearch extends AbstractRollingUpgradeTestCase{
private static final String TEXT_UPGRADED= "Hello world upgraded";
private static final int NUM_DOCS = 1;

//Test rolling-upgrade Semantic Search
//Create Text Embedding Processor, Ingestion Pipeline and add document
//Validate process , pipeline and document count in rolling-upgrade scenario
public void testSemanticSearch() throws Exception{
waitForClusterHealthGreen(NODES_BWC_CLUSTER);
switch (getClusterType()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.apache.hc.core5.http.*;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.HttpHeaders;
import org.apache.hc.core5.http.ParseException;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.entity.StringEntity;
import org.apache.hc.core5.http.message.BasicHeader;
Expand Down Expand Up @@ -850,26 +854,26 @@ protected Map<String, Object> getIngestionPipeline(String pipelineName) {
return (Map<String, Object>) responseMap.get(pipelineName);
}

/**
* Get indices
*/
@SneakyThrows
protected void getIndices() {
Request request = new Request("GET", "/_cat/indices");
Response response = client().performRequest(request);
String responseBody = EntityUtils.toString(response.getEntity());
logger.info("Indices are ============================");
logger.info(responseBody);
}

@SneakyThrows
protected void getShards() {
Request request = new Request("GET", "/_cat/shards");
Response response = client().performRequest(request);
String responseBody = EntityUtils.toString(response.getEntity());
logger.info("Shards are ============================");
logger.info(responseBody);
}
// /**
// * Get indices
// */
// @SneakyThrows
// protected void getIndices() {
// Request request = new Request("GET", "/_cat/indices");
// Response response = client().performRequest(request);
// String responseBody = EntityUtils.toString(response.getEntity());
// logger.info("Indices are ============================");
// logger.info(responseBody);
// }
//
// @SneakyThrows
// protected void getShards() {
// Request request = new Request("GET", "/_cat/shards");
// Response response = client().performRequest(request);
// String responseBody = EntityUtils.toString(response.getEntity());
// logger.info("Shards are ============================");
// logger.info(responseBody);
// }

/**
* Enumeration for types of pipeline processors, used to lookup resources like create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
import static org.opensearch.neuralsearch.TestUtils.SKIP_DELETE_MODEL_INDEX;

import java.io.IOException;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import org.apache.hc.client5.http.auth.AuthScope;
Expand Down

0 comments on commit a5d17e1

Please sign in to comment.