Skip to content

Commit 9ee315a

Browse files
committed
Build: Improve integ test to match ant behavior
Many other improvements: * Use spaces in ES path * Use space in path for plugin file installation * Use a different cwd than ES home * Use jps to ensure process being stopped is actually elasticsearch * Stop ES if pid file already exists * Delete pid file when successfully killed Also, refactored the cluster formation code to be a little more organized. closes elastic#14464
1 parent f031961 commit 9ee315a

File tree

4 files changed

+222
-143
lines changed

4 files changed

+222
-143
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PluginBuildPlugin extends BuildPlugin {
4949
project.integTest.configure {
5050
dependsOn project.bundlePlugin
5151
cluster {
52-
plugin 'installPlugin', project.bundlePlugin.outputs.files
52+
plugin project.name, project.bundlePlugin.outputs.files
5353
}
5454
}
5555
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,18 @@ class ClusterConfiguration {
4141

4242
Map<String, String> systemProperties = new HashMap<>()
4343

44-
@Input
45-
void systemProperty(String property, String value) {
46-
systemProperties.put(property, value)
47-
}
44+
LinkedHashMap<String, FileCollection> plugins = new LinkedHashMap<>()
4845

4946
LinkedHashMap<String, Object[]> setupCommands = new LinkedHashMap<>()
5047

5148
@Input
5249
void plugin(String name, FileCollection file) {
53-
setupCommands.put(name, ['bin/plugin', 'install', new LazyFileUri(file: file)])
50+
plugins.put(name, file)
5451
}
5552

56-
static class LazyFileUri {
57-
FileCollection file
58-
@Override
59-
String toString() {
60-
return file.singleFile.toURI().toURL().toString();
61-
}
62-
53+
@Input
54+
void systemProperty(String property, String value) {
55+
systemProperties.put(property, value)
6356
}
6457

6558
@Input

0 commit comments

Comments
 (0)