Skip to content

Commit

Permalink
Fix it failure (#321)
Browse files Browse the repository at this point in the history
* Fix IT failures

Signed-off-by: zane-neo <[email protected]>

* format code

Signed-off-by: zane-neo <[email protected]>

* fix

Signed-off-by: zhichao-aws <[email protected]>

* nit

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zane-neo <[email protected]>
Signed-off-by: zhichao-aws <[email protected]>
Co-authored-by: zhichao-aws <[email protected]>
  • Loading branch information
zane-neo and zhichao-aws authored Jun 12, 2024
1 parent 62ac87f commit 5362a9a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ public void testNeuralSparseSearchToolInFlowAgent_withIllegalEmbeddingField_then
org.hamcrest.MatcherAssert
.assertThat(
exception.getMessage(),
allOf(containsString("all shards failed"), containsString("SearchPhaseExecutionException"))
allOf(
containsString("[neural_sparse] query only works on [rank_features] fields"),
containsString("IllegalArgumentException")
)
);
}

Expand Down
14 changes: 10 additions & 4 deletions src/test/java/org/opensearch/integTest/RAGToolIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ public void testRAGToolWithNeuralSparseQuery_withIllegalEmbeddingField_thenThrow
org.hamcrest.MatcherAssert
.assertThat(
exception.getMessage(),
allOf(containsString("all shards failed"), containsString("SearchPhaseExecutionException"))
allOf(
containsString("[neural_sparse] query only works on [rank_features] fields"),
containsString("IllegalArgumentException")
)
);
}

Expand All @@ -365,7 +368,10 @@ public void testRAGToolWithNeuralSparseQueryAndLLM_withIllegalEmbeddingField_the
org.hamcrest.MatcherAssert
.assertThat(
exception.getMessage(),
allOf(containsString("all shards failed"), containsString("SearchPhaseExecutionException"))
allOf(
containsString("[neural_sparse] query only works on [rank_features] fields"),
containsString("IllegalArgumentException")
)
);
}

Expand All @@ -376,7 +382,7 @@ public void testRAGToolWithNeuralQuery_withIllegalEmbeddingField_thenThrowExcept
org.hamcrest.MatcherAssert
.assertThat(
exception.getMessage(),
allOf(containsString("all shards failed"), containsString("SearchPhaseExecutionException"))
allOf(containsString("Field 'embedding2' is not knn_vector type."), containsString("IllegalArgumentException"))
);
}

Expand All @@ -387,7 +393,7 @@ public void testRAGToolWithNeuralQueryAndLLM_withIllegalEmbeddingField_thenThrow
org.hamcrest.MatcherAssert
.assertThat(
exception.getMessage(),
allOf(containsString("all shards failed"), containsString("SearchPhaseExecutionException"))
allOf(containsString("Field 'embedding2' is not knn_vector type."), containsString("IllegalArgumentException"))
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/opensearch/integTest/VectorDBToolIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void testVectorDBToolInFlowAgent_withIllegalEmbeddingField_thenThrowExcep
org.hamcrest.MatcherAssert
.assertThat(
exception.getMessage(),
allOf(containsString("all shards failed"), containsString("SearchPhaseExecutionException"))
allOf(containsString("Field 'embedding2' is not knn_vector type."), containsString("IllegalArgumentException"))
);
}

Expand Down

0 comments on commit 5362a9a

Please sign in to comment.