diff --git a/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java b/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java index c93f39902e5..38a52f67b3e 100644 --- a/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java +++ b/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java @@ -112,6 +112,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.hasToString; import static org.hamcrest.Matchers.not; @@ -726,7 +727,7 @@ public class InstallPluginCommandTests extends ESTestCase { assertInstallCleaned(env.v2()); } - public void testOfficialPluginsHelpSorted() throws Exception { + public void testOfficialPluginsHelpSortedAndMissingObviouslyWrongPlugins() throws Exception { MockTerminal terminal = new MockTerminal(); new InstallPluginCommand() { @Override @@ -749,6 +750,9 @@ public class InstallPluginCommandTests extends ESTestCase { assertTrue(prev + " < " + line, prev.compareTo(line) < 0); prev = line; line = reader.readLine(); + // qa is not really a plugin and it shouldn't sneak in + assertThat(line, not(endsWith("qa"))); + assertThat(line, not(endsWith("example"))); } } } diff --git a/server/build.gradle b/server/build.gradle index 1b507e542c4..39579bed288 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -172,9 +172,9 @@ task generateModulesList { } task generatePluginsList { - List plugins = project(':plugins').subprojects - .findAll { it.name.contains('example') == false } - .collect { it.name } + Set plugins = new TreeSet<>(project(':plugins').childProjects.keySet()) + plugins.remove('example') + File pluginsFile = new File(buildDir, 'generated-resources/plugins.txt') processResources.from(pluginsFile) inputs.property('plugins', plugins)