Skip to content

Commit

Permalink
Enable mixed version testing of ES|QL semantic_text
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty committed Oct 25, 2024
1 parent e7897bd commit 82a6381
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ restResources {
dependencies {
javaRestTestImplementation project(xpackModule('esql:qa:testFixtures'))
javaRestTestImplementation project(xpackModule('esql:qa:server'))
clusterPlugins project(':x-pack:plugin:inference:qa:test-service-plugin')
}

GradleUtils.extendSourceSet(project, "javaRestTest", "yamlRestTest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static ElasticsearchCluster mixedVersionCluster() {
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.setting("cluster.routing.rebalance.enable", "none") // disable relocation until we have retry in ESQL
.plugin("inference-service-test")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,4 @@ protected boolean supportsAsync() {
protected boolean enableRoundingDoubleValuesOnAsserting() {
return true;
}

@Override
protected boolean supportsInferenceTestService() {
return false;
}
}
1 change: 1 addition & 0 deletions x-pack/plugin/esql/qa/server/multi-clusters/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ apply plugin: 'elasticsearch.bwc-test'
dependencies {
javaRestTestImplementation project(xpackModule('esql:qa:testFixtures'))
javaRestTestImplementation project(xpackModule('esql:qa:server'))
clusterPlugins project(':x-pack:plugin:inference:qa:test-service-plugin')
}

def supportedVersion = bwcVersion -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static ElasticsearchCluster remoteCluster() {
.setting("xpack.license.self_generated.type", "trial")
.shared(true)
.setting("cluster.routing.rebalance.enable", "none")
.plugin("inference-service-test")
.build();
}

Expand All @@ -43,6 +44,7 @@ public static ElasticsearchCluster localCluster(ElasticsearchCluster remoteClust
.setting("cluster.remote.connections_per_cluster", "1")
.shared(true)
.setting("cluster.routing.rebalance.enable", "none")
.plugin("inference-service-test")
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,4 @@ static boolean hasIndexMetadata(String query) {
protected boolean enableRoundingDoubleValuesOnAsserting() {
return true;
}

@Override
protected boolean supportsInferenceTestService() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected EsqlSpecTestCase(

@Before
public void setup() throws IOException {
if (supportsInferenceTestService() && clusterHasInferenceEndpoint(client()) == false) {
if (clusterHasInferenceEndpoint(client()) == false) {
createInferenceEndpoint(client());
}

Expand Down Expand Up @@ -173,9 +173,6 @@ public final void test() throws Throwable {
}

protected void shouldSkipTest(String testName) throws IOException {
if (testCase.requiredCapabilities.contains("semantic_text_type")) {
assumeTrue("Inference test service needs to be supported for semantic_text", supportsInferenceTestService());
}
checkCapabilities(adminClient(), testFeatureService, testName, testCase);
assumeTrue("Test " + testName + " is not enabled", isEnabled(testName, instructions, Version.CURRENT));
}
Expand Down Expand Up @@ -219,10 +216,6 @@ protected static void checkCapabilities(RestClient client, TestFeatureService te
}
}

protected boolean supportsInferenceTestService() {
return true;
}

protected final void doTest() throws Throwable {
RequestObjectBuilder builder = new RequestObjectBuilder(randomFrom(XContentType.values()));

Expand Down

0 comments on commit 82a6381

Please sign in to comment.