Skip to content

Commit 7001fcc

Browse files
Only use test-error-query in snapshot builds (elastic#131134)
* Only use test-error-query in snapshot builds * Remove ban on StandaloneRestIntegTestTask in release --------- Co-authored-by: Mark Vieira <[email protected]>
1 parent 79bdc32 commit 7001fcc

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

x-pack/plugin/async-search/build.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
2-
31
apply plugin: 'elasticsearch.internal-es-plugin'
42
apply plugin: 'elasticsearch.internal-cluster-test'
53
apply plugin: 'elasticsearch.internal-java-rest-test'
@@ -36,8 +34,3 @@ restResources {
3634
include '_common', 'indices', 'index', 'async_search'
3735
}
3836
}
39-
40-
tasks.withType(StandaloneRestIntegTestTask).configureEach {
41-
def isSnapshot = buildParams.snapshotBuild
42-
it.onlyIf("snapshot build") { isSnapshot }
43-
}

x-pack/plugin/async-search/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,28 @@ public class AsyncSearchSecurityIT extends ESRestTestCase {
9393
}
9494

9595
@ClassRule
96-
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
97-
.module("test-error-query")
98-
.module("analysis-common")
99-
.module("x-pack-async-search")
100-
.setting("xpack.license.self_generated.type", "trial")
101-
.setting("xpack.security.enabled", "true")
102-
.rolesFile(Resource.fromClasspath("roles.yml"))
103-
.user("test_kibana_user", "x-pack-test-password", "kibana_system", false)
104-
.user("test-admin", "x-pack-test-password", "test-admin", false)
105-
.user("user1", "x-pack-test-password", "user1", false)
106-
.user("user2", "x-pack-test-password", "user2", false)
107-
.user("user-dls", "x-pack-test-password", "user-dls", false)
108-
.user("user-cancel", "x-pack-test-password", "user-cancel", false)
109-
.user("user-monitor", "x-pack-test-password", "user-monitor", false)
110-
.build();
96+
public static ElasticsearchCluster cluster = getCluster();
97+
98+
private static ElasticsearchCluster getCluster() {
99+
var builder = ElasticsearchCluster.local()
100+
.module("analysis-common")
101+
.module("x-pack-async-search")
102+
.setting("xpack.license.self_generated.type", "trial")
103+
.setting("xpack.security.enabled", "true")
104+
.rolesFile(Resource.fromClasspath("roles.yml"))
105+
.user("test_kibana_user", "x-pack-test-password", "kibana_system", false)
106+
.user("test-admin", "x-pack-test-password", "test-admin", false)
107+
.user("user1", "x-pack-test-password", "user1", false)
108+
.user("user2", "x-pack-test-password", "user2", false)
109+
.user("user-dls", "x-pack-test-password", "user-dls", false)
110+
.user("user-cancel", "x-pack-test-password", "user-cancel", false)
111+
.user("user-monitor", "x-pack-test-password", "user-monitor", false);
112+
if (Build.current().isSnapshot()) {
113+
// Only in non-release builds we can use the error_query
114+
builder = builder.module("test-error-query");
115+
}
116+
return builder.build();
117+
}
111118

112119
@Override
113120
protected String getTestRestCluster() {

0 commit comments

Comments
 (0)