Skip to content

Commit 30de60b

Browse files
committed
Only use test-error-query in snapshot builds
1 parent d73a786 commit 30de60b

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

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)