From f1fd5350c9920fdd07c4985a797a4b4906b3aa73 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 15 May 2017 12:58:11 -0700 Subject: [PATCH] Test: Fix how packaging test generates expected plugins --- qa/vagrant/build.gradle | 19 +++++++++++++++---- .../resources/packaging/utils/plugins.bash | 4 +--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/qa/vagrant/build.gradle b/qa/vagrant/build.gradle index aa118f1075b..a00e2c81736 100644 --- a/qa/vagrant/build.gradle +++ b/qa/vagrant/build.gradle @@ -19,12 +19,23 @@ apply plugin: 'elasticsearch.vagrant' -dependencies { - // Collect all the plugins - for (Project subproj : project.rootProject.subprojects) { - if (subproj.path.startsWith(':plugins:')) { +List plugins = [] +for (Project subproj : project.rootProject.subprojects) { + if (subproj.path.startsWith(':plugins:')) { + // add plugin as a dep + dependencies { bats project(path: "${subproj.path}", configuration: 'zip') } + plugins.add(subproj.name) + } +} +plugins = plugins.toSorted() + +setupBats { + doFirst { + File expectedPlugins = file('build/plugins/expected') + expectedPlugins.parentFile.mkdirs() + expectedPlugins.setText(plugins.join('\n'), 'UTF-8') } } diff --git a/qa/vagrant/src/test/resources/packaging/utils/plugins.bash b/qa/vagrant/src/test/resources/packaging/utils/plugins.bash index f8c40d27420..14650b7130b 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/plugins.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/plugins.bash @@ -173,8 +173,6 @@ install_and_check_plugin() { # $2 description of the source of the plugin list compare_plugins_list() { cat $1 | sort > /tmp/plugins - ls /elasticsearch/plugins/*/build.gradle | cut -d '/' -f 4 | - sort > /tmp/expected echo "Checking plugins from $2 (<) against expected plugins (>):" - diff /tmp/expected /tmp/plugins + diff -w /elasticsearch/qa/vagrant/build/plugins/expected /tmp/plugins }