Skip to content

Commit ed57e42

Browse files
committed
single module
1 parent 9fe5a6a commit ed57e42

File tree

4 files changed

+15
-31
lines changed

4 files changed

+15
-31
lines changed

test/external-modules/error-query/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@
88
*/
99

1010
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
11+
apply plugin: 'elasticsearch.internal-java-rest-test'
12+
13+
tasks.named('javaRestTest') {
14+
usesDefaultDistribution()
15+
it.onlyIf("snapshot build") { buildParams.isSnapshotBuild() }
16+
}
1117

1218
tasks.named('yamlRestTest').configure {
1319
it.onlyIf("snapshot build") { buildParams.isSnapshotBuild() }
1420
}
1521

22+
dependencies {
23+
api project(':test:framework')
24+
}
1625
esplugin {
1726
description = 'A test module that exposes a way to simulate search shard failures and warnings'
1827
classname ='org.elasticsearch.test.errorquery.ErrorQueryPlugin'
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
package org.elasticsearch.test.failingfield;
10+
package org.elasticsearch.test.esql;
1111

1212
import org.apache.http.util.EntityUtils;
1313
import org.elasticsearch.client.Request;
@@ -26,13 +26,13 @@
2626

2727
import static org.hamcrest.Matchers.containsString;
2828
import static org.hamcrest.Matchers.equalTo;
29-
import static org.hamcrest.Matchers.hasSize;
29+
import static org.hamcrest.Matchers.lessThanOrEqualTo;
3030

3131
public class EsqlPartialResultsIT extends ESRestTestCase {
3232
@ClassRule
3333
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
3434
.distribution(DistributionType.DEFAULT)
35-
.module("test-failing-field")
35+
.module("test-error-query")
3636
.setting("xpack.security.enabled", "false")
3737
.setting("xpack.license.self_generated.type", "trial")
3838
.setting("esql.query.allow_partial_results", "true")
@@ -117,7 +117,7 @@ public void testPartialResult() throws Exception {
117117
List<?> columns = (List<?>) results.get("columns");
118118
assertThat(columns, equalTo(List.of(Map.of("name", "fail_me", "type", "long"), Map.of("name", "v", "type", "long"))));
119119
List<?> values = (List<?>) results.get("values");
120-
assertThat(values, hasSize(okIds.size()));
120+
assertThat(values.size(), lessThanOrEqualTo(okIds.size()));
121121
}
122122
// allow_partial_results = false
123123
{

test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
package org.elasticsearch.test.errorquery;
1111

12-
import org.elasticsearch.plugins.Plugin;
1312
import org.elasticsearch.plugins.SearchPlugin;
13+
import org.elasticsearch.test.FailingFieldPlugin;
1414

1515
import java.util.List;
1616

@@ -19,7 +19,7 @@
1919
/**
2020
* Test plugin that exposes a way to simulate search shard failures and warnings.
2121
*/
22-
public class ErrorQueryPlugin extends Plugin implements SearchPlugin {
22+
public class ErrorQueryPlugin extends FailingFieldPlugin implements SearchPlugin {
2323
public ErrorQueryPlugin() {}
2424

2525
@Override

test/external-modules/failing-field/build.gradle

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)