Skip to content

Commit 394c190

Browse files
committed
Strengthen no-kNN integration tests with exact message and scan-operator assertions
Signed-off-by: Eric Wei <mengwei.eric@gmail.com>
1 parent c443be5 commit 394c190

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/sql/VectorSearchIT.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,13 @@ public void testExecutionWithoutKnnPluginReturnsCapabilityError() throws IOExcep
362362
+ "', field='embedding', vector='[1.0, 2.0]', option='k=5') AS v "
363363
+ "LIMIT 5"));
364364

365-
assertThat(ex.getMessage(), containsString("k-NN plugin"));
366-
assertThat(ex.getMessage(), containsString("not installed"));
365+
// Lock in the full user-facing sentence, not just loose substrings — the exact wording is
366+
// part of the contract and regressions should fail loudly rather than keep passing on a
367+
// subtly reworded message.
368+
assertThat(
369+
ex.getMessage(),
370+
containsString(
371+
"vectorSearch() requires the k-NN plugin, which is not installed on this cluster."));
367372
}
368373

369374
@Test
@@ -379,6 +384,9 @@ public void testExplainWithoutKnnPluginStillWorks() throws IOException {
379384
+ "', field='embedding', vector='[1.0, 2.0]', option='k=5') AS v "
380385
+ "LIMIT 5");
381386

387+
// Assert the scan-operator name, not just "wrapper": the name confirms the plan reached
388+
// the vectorSearch scan builder rather than some other scan shape.
389+
assertThat(explain, containsString("VectorSearchIndexScan"));
382390
assertThat(explain, containsString("wrapper"));
383391
}
384392

0 commit comments

Comments
 (0)