From 6b92f7b0c34757ed69a59fb950bc1791a56bf3c1 Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Tue, 23 Jul 2024 17:53:45 -0700 Subject: [PATCH] Fix bwc test Signed-off-by: Louis Chu --- integ-test/build.gradle | 75 +++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/integ-test/build.gradle b/integ-test/build.gradle index b65049ec0e..3a71ccc82a 100644 --- a/integ-test/build.gradle +++ b/integ-test/build.gradle @@ -223,11 +223,11 @@ testClusters.all { } } -testClusters { - integTest { - testDistribution = 'archive' - plugin(provider({ - new RegularFile() { +def getJobSchedulerPlugin() { + provider(new Callable() { + @Override + RegularFile call() throws Exception { + return new RegularFile() { @Override File getAsFile() { return configurations.zipArchive.asFileTree.matching { @@ -235,50 +235,30 @@ testClusters { }.singleFile } } - })) + } + }) +} + +testClusters { + integTest { + testDistribution = 'archive' + plugin(getJobSchedulerPlugin()) plugin ":opensearch-sql-plugin" setting "plugins.query.datasources.encryption.masterkey", "1234567812345678" } remoteCluster { testDistribution = 'archive' - plugin(provider({ - new RegularFile() { - @Override - File getAsFile() { - return configurations.zipArchive.asFileTree.matching { - include '**/opensearch-job-scheduler*' - }.singleFile - } - } - })) + plugin(getJobSchedulerPlugin()) plugin ":opensearch-sql-plugin" } integTestWithSecurity { testDistribution = 'archive' - plugin(provider({ - new RegularFile() { - @Override - File getAsFile() { - return configurations.zipArchive.asFileTree.matching { - include '**/opensearch-job-scheduler*' - }.singleFile - } - } - })) + plugin(getJobSchedulerPlugin()) plugin ":opensearch-sql-plugin" } remoteIntegTestWithSecurity { testDistribution = 'archive' - plugin(provider({ - new RegularFile() { - @Override - File getAsFile() { - return configurations.zipArchive.asFileTree.matching { - include '**/opensearch-job-scheduler*' - }.singleFile - } - } - })) + plugin(getJobSchedulerPlugin()) plugin ":opensearch-sql-plugin" } } @@ -584,17 +564,18 @@ task comparisonTest(type: RestIntegTestTask) { } List> plugins = [ - provider(new Callable() { - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - return fileTree(bwcFilePath + project.version).getSingleFile() + getJobSchedulerPlugin(), + provider(new Callable() { + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return fileTree(bwcFilePath + project.version).getSingleFile() + } } } - } - }) + }) ] // Creates 2 test clusters with 3 nodes of the old version. @@ -619,6 +600,7 @@ task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) { useCluster testClusters."${baseName}0" dependsOn "${baseName}#oldVersionClusterTask0" doFirst { + println "List of plugins: $plugins" testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) } filter { @@ -638,6 +620,7 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas dependsOn "${baseName}#mixedClusterTask" useCluster testClusters."${baseName}0" doFirst { + println "List of plugins: $plugins" testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) } filter { @@ -657,6 +640,7 @@ task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) dependsOn "${baseName}#twoThirdsUpgradedClusterTask" useCluster testClusters."${baseName}0" doFirst { + println "List of plugins: $plugins" testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) } filter { @@ -676,6 +660,7 @@ task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) { dependsOn "${baseName}#oldVersionClusterTask1" useCluster testClusters."${baseName}1" doFirst { + println "List of plugins: $plugins" testClusters."${baseName}1".upgradeAllNodesAndPluginsToNextVersion(plugins) } filter {