Build: Fix official plugins list (#35661)

The list of official plugins accidentally included `qa` projects like,
well, `qa` and `amazon-ec2`. This changes the mechanism that we use to
build the list and adds a test to catch this.

Closes #35623
This commit is contained in:
Nik Everett 2018-11-19 10:17:05 -05:00 committed by GitHub
parent 6d4a3f8fce
commit 036c15d8a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -112,6 +112,7 @@ import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.hasToString; import static org.hamcrest.Matchers.hasToString;
import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.not;
@ -726,7 +727,7 @@ public class InstallPluginCommandTests extends ESTestCase {
assertInstallCleaned(env.v2()); assertInstallCleaned(env.v2());
} }
public void testOfficialPluginsHelpSorted() throws Exception { public void testOfficialPluginsHelpSortedAndMissingObviouslyWrongPlugins() throws Exception {
MockTerminal terminal = new MockTerminal(); MockTerminal terminal = new MockTerminal();
new InstallPluginCommand() { new InstallPluginCommand() {
@Override @Override
@ -749,6 +750,9 @@ public class InstallPluginCommandTests extends ESTestCase {
assertTrue(prev + " < " + line, prev.compareTo(line) < 0); assertTrue(prev + " < " + line, prev.compareTo(line) < 0);
prev = line; prev = line;
line = reader.readLine(); 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")));
} }
} }
} }

View File

@ -172,9 +172,9 @@ task generateModulesList {
} }
task generatePluginsList { task generatePluginsList {
List<String> plugins = project(':plugins').subprojects Set<String> plugins = new TreeSet<>(project(':plugins').childProjects.keySet())
.findAll { it.name.contains('example') == false } plugins.remove('example')
.collect { it.name }
File pluginsFile = new File(buildDir, 'generated-resources/plugins.txt') File pluginsFile = new File(buildDir, 'generated-resources/plugins.txt')
processResources.from(pluginsFile) processResources.from(pluginsFile)
inputs.property('plugins', plugins) inputs.property('plugins', plugins)