Skip to content

Commit

Permalink
Updating HuggingFaceIT ELSER tests for inference endpoint validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-rubinstein committed Sep 25, 2024
1 parent a1d6785 commit 1d7d0fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public void testElser() throws IOException {
final String inferenceId = "mixed-cluster-elser";
final String upgradedClusterId = "upgraded-cluster-elser";

elserServer.enqueue(new MockResponse().setResponseCode(200).setBody(elserResponse()));
put(inferenceId, elserConfig(getUrl(elserServer)), TaskType.SPARSE_EMBEDDING);

var configs = (List<Map<String, Object>>) get(TaskType.SPARSE_EMBEDDING, inferenceId).get("endpoints");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public void testElser() throws IOException {
var testTaskType = TaskType.SPARSE_EMBEDDING;

if (isOldCluster()) {
elserServer.enqueue(new MockResponse().setResponseCode(200).setBody(elserResponse()));
put(oldClusterId, elserConfig(getUrl(elserServer)), testTaskType);
var configs = (List<Map<String, Object>>) get(testTaskType, oldClusterId).get(old_cluster_endpoint_identifier);
assertThat(configs, hasSize(1));
Expand All @@ -136,6 +137,7 @@ public void testElser() throws IOException {
assertElser(oldClusterId);

// New endpoint
elserServer.enqueue(new MockResponse().setResponseCode(200).setBody(elserResponse()));
put(upgradedClusterId, elserConfig(getUrl(elserServer)), testTaskType);
configs = (List<Map<String, Object>>) get(upgradedClusterId).get("endpoints");
assertThat(configs, hasSize(1));
Expand Down

0 comments on commit 1d7d0fe

Please sign in to comment.