From 37ec0cb754501530cfd86e0528753a016ed5256f 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 | 113 ++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 63 deletions(-) diff --git a/integ-test/build.gradle b/integ-test/build.gradle index b65049ec0e..7cb43f2546 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" } } @@ -546,24 +526,7 @@ task comparisonTest(type: RestIntegTestTask) { testDistribution = "ARCHIVE" versions = [baseVersion, opensearch_version] numberOfNodes = 3 - plugin(provider(new Callable(){ - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - if (new File("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion").exists()) { - project.delete(files("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion")) - } - project.mkdir bwcJobSchedulerPath + bwcVersion - ant.get(src: bwcOpenSearchJSDownload, - dest: bwcJobSchedulerPath + bwcVersion, - httpusecaches: false) - return fileTree(bwcJobSchedulerPath + bwcVersion).getSingleFile() - } - } - } - })) + plugin(getJobSchedulerPlugin()) plugin(provider(new Callable(){ @Override RegularFile call() throws Exception { @@ -584,17 +547,37 @@ 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() + provider(new Callable() { + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + if (new File("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion").exists()) { + project.delete(files("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion")) + } + project.mkdir bwcJobSchedulerPath + bwcVersion + ant.get(src: bwcOpenSearchJSDownload, + dest: bwcJobSchedulerPath + bwcVersion, + httpusecaches: false) + return fileTree(bwcJobSchedulerPath + bwcVersion).getSingleFile() + } } } - } - }) + }), + provider(new Callable() { + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return configurations.zipArchive.asFileTree.matching { + include '**/opensearch-sql-plugin*' + }.singleFile + } + } + } + }) ] // Creates 2 test clusters with 3 nodes of the old version. @@ -619,6 +602,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 +622,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 +642,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 +662,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 {