Rename testcluster extension to align with plugin name (#34751)
This commit is contained in:
parent
0f1a5ecf61
commit
4370b44ef0
|
@ -39,8 +39,8 @@ import java.util.Map;
|
|||
|
||||
public class TestClustersPlugin implements Plugin<Project> {
|
||||
|
||||
public static final String LIST_TASK_NAME = "listElasticSearchClusters";
|
||||
public static final String EXTENSION_NAME = "elasticSearchClusters";
|
||||
private static final String LIST_TASK_NAME = "listTestClusters";
|
||||
private static final String NODE_EXTENSION_NAME = "testClusters";
|
||||
|
||||
private final Logger logger = Logging.getLogger(TestClustersPlugin.class);
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class TestClustersPlugin implements Plugin<Project> {
|
|||
ElasticsearchNode.class,
|
||||
(name) -> new ElasticsearchNode(name, GradleServicesAdapter.getInstance(project))
|
||||
);
|
||||
project.getExtensions().add(EXTENSION_NAME, container);
|
||||
project.getExtensions().add(NODE_EXTENSION_NAME, container);
|
||||
|
||||
Task listTask = project.getTasks().create(LIST_TASK_NAME);
|
||||
listTask.setGroup("ES cluster formation");
|
||||
|
|
|
@ -31,11 +31,11 @@ public class TestClustersPluginIT extends GradleIntegrationTestCase {
|
|||
public void testListClusters() {
|
||||
BuildResult result = GradleRunner.create()
|
||||
.withProjectDir(getProjectDir("testclusters"))
|
||||
.withArguments("listElasticSearchClusters", "-s")
|
||||
.withArguments("listTestClusters", "-s")
|
||||
.withPluginClasspath()
|
||||
.build();
|
||||
|
||||
assertEquals(TaskOutcome.SUCCESS, result.task(":listElasticSearchClusters").getOutcome());
|
||||
assertEquals(TaskOutcome.SUCCESS, result.task(":listTestClusters").getOutcome());
|
||||
assertOutputContains(
|
||||
result.getOutput(),
|
||||
" * myTestCluster:"
|
||||
|
|
|
@ -2,40 +2,40 @@ plugins {
|
|||
id 'elasticsearch.testclusters'
|
||||
}
|
||||
|
||||
elasticSearchClusters {
|
||||
testClusters {
|
||||
myTestCluster {
|
||||
distribution = 'ZIP'
|
||||
}
|
||||
}
|
||||
|
||||
task user1 {
|
||||
useCluster elasticSearchClusters.myTestCluster
|
||||
useCluster testClusters.myTestCluster
|
||||
doLast {
|
||||
println "user1 executing"
|
||||
}
|
||||
}
|
||||
|
||||
task user2 {
|
||||
useCluster elasticSearchClusters.myTestCluster
|
||||
useCluster testClusters.myTestCluster
|
||||
doLast {
|
||||
println "user2 executing"
|
||||
}
|
||||
}
|
||||
|
||||
task upToDate1 {
|
||||
useCluster elasticSearchClusters.myTestCluster
|
||||
useCluster testClusters.myTestCluster
|
||||
}
|
||||
|
||||
task upToDate2 {
|
||||
useCluster elasticSearchClusters.myTestCluster
|
||||
useCluster testClusters.myTestCluster
|
||||
}
|
||||
|
||||
task skipped1 {
|
||||
enabled = false
|
||||
useCluster elasticSearchClusters.myTestCluster
|
||||
useCluster testClusters.myTestCluster
|
||||
}
|
||||
|
||||
task skipped2 {
|
||||
enabled = false
|
||||
useCluster elasticSearchClusters.myTestCluster
|
||||
useCluster testClusters.myTestCluster
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue