Skip to content

Commit bf26c1b

Browse files
committed
Add MultiProjectEnabledClusterConfigProvider
1 parent c30fab6 commit bf26c1b

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/DefaultLocalClusterSpecBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public final class DefaultLocalClusterSpecBuilder extends AbstractLocalClusterSp
2020
public DefaultLocalClusterSpecBuilder() {
2121
super();
2222
this.apply(new FipsEnabledClusterConfigProvider());
23+
this.apply(new MultiProjectEnabledClusterConfigProvider());
2324
this.systemProperties(new DefaultSystemPropertyProvider());
2425
this.settings(new DefaultSettingsProvider());
2526
this.environment(new DefaultEnvironmentProvider());
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.test.cluster.local;
11+
12+
public class MultiProjectEnabledClusterConfigProvider implements LocalClusterConfigProvider {
13+
14+
@Override
15+
public void apply(LocalClusterSpecBuilder<?> builder) {
16+
if (isMultiProjectEnabled()) {
17+
builder.setting("test.multi_project.enabled", "true");
18+
}
19+
}
20+
21+
private static boolean isMultiProjectEnabled() {
22+
// TODO: we need to use `tests` instead of `test` here to make gradle passes the system property,
23+
// but we need `test` in the setting.
24+
return Boolean.getBoolean("tests.multi_project.enabled");
25+
}
26+
}

x-pack/plugin/security/qa/multi-project/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/jwt/JwtMultiProjectIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public class JwtMultiProjectIT extends ESRestTestCase {
5151
.nodes(1)
5252
.distribution(DistributionType.DEFAULT)
5353
.module("test-multi-project")
54-
.setting("test.multi_project.enabled", "true")
5554
.configFile("jwkset.json", Resource.fromClasspath("jwk/jwkset.json"))
5655
.setting("xpack.ml.enabled", "false")
5756
.setting("xpack.license.self_generated.type", "trial")

x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,5 @@ tasks.named("yamlRestTest").configure {
8282
blacklist += [];
8383
}
8484
systemProperty 'tests.rest.blacklist', blacklist.join(',')
85-
8685
systemProperty "test.multi_project.enabled", true
8786
}

x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/src/yamlRestTest/java/org/elasticsearch/multiproject/test/CoreWithMultipleProjectsClientYamlTestSuiteIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public class CoreWithMultipleProjectsClientYamlTestSuiteIT extends MultipleProje
3737
.module("test-multi-project")
3838
.module("lang-mustache")
3939
.module("parent-join")
40-
.setting("test.multi_project.enabled", "true")
4140
.setting("xpack.security.enabled", "true")
4241
.setting("xpack.watcher.enabled", "false")
4342
.setting("xpack.ml.enabled", "false")

x-pack/qa/multi-project/xpack-rest-tests-with-multiple-projects/src/yamlRestTest/java/org/elasticsearch/multiproject/test/XpackWithMultipleProjectsClientYamlTestSuiteIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class XpackWithMultipleProjectsClientYamlTestSuiteIT extends MultipleProj
2626
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
2727
.distribution(DistributionType.DEFAULT)
2828
.name("yamlRestTest")
29-
.setting("test.multi_project.enabled", "true")
3029
.setting("xpack.ml.enabled", "true")
3130
.setting("xpack.security.enabled", "true")
3231
.setting("xpack.watcher.enabled", "false")

0 commit comments

Comments
 (0)