From 85ea418f037fe4ea29c13418fc99707a08664f82 Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Fri, 5 Aug 2022 16:59:38 -0700 Subject: [PATCH 1/5] removed odfe bwc test Signed-off-by: Shenoy Pratik --- reports-scheduler/build.gradle | 188 --------------------------------- 1 file changed, 188 deletions(-) diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index ddc2a28f..df277e1d 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -315,194 +315,6 @@ testClusters.integTest { setting 'path.repo', repo.absolutePath } -// For job-scheduler and reports-scheduler, the latest opendistro releases appear to be 1.13.0.0. -String bwcVersion = "1.13.0.0" -String baseName = "reportsSchedulerBwcCluster" -String bwcFilePath = "src/test/resources/bwc" -String bwcJobSchedulerURL = "https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-job-scheduler/opendistro-job-scheduler-" + bwcVersion + ".zip" -String bwcReportsSchedulerURL = "https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-reports-scheduler/opendistro-reports-scheduler-" + bwcVersion + ".zip" - -2.times {i -> - testClusters { - "${baseName}$i" { - testDistribution = "ARCHIVE" - versions = ["7.10.2", opensearch_version] - numberOfNodes = 3 - plugin(provider(new Callable(){ - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - File dir = new File(bwcFilePath + "/job-scheduler/" + bwcVersion) - if (!dir.exists()) { - dir.mkdirs() - } - File file = new File(dir, "opendistro-job-scheduler-" + bwcVersion + ".zip") - if (!file.exists()) { - new URL(bwcJobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} - } - return fileTree(bwcFilePath + "/job-scheduler/" + bwcVersion).getSingleFile() - } - } - } - })) - plugin(provider(new Callable(){ - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - File dir = new File(bwcFilePath + "/reports-scheduler/" + bwcVersion) - if (!dir.exists()) { - dir.mkdirs() - } - File file = new File(dir, "opendistro-reports-scheduler-" + bwcVersion + ".zip") - if (!file.exists()) { - new URL(bwcReportsSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} - } - return fileTree(bwcFilePath + "/reports-scheduler/" + bwcVersion).getSingleFile() - } - } - } - })) - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - setting 'http.content_type.required', 'true' - } - } -} - -List> plugins = [] - -// Ensure the artifact for the current project version is available to be used for the bwc tests -task prepareBwcTests { - dependsOn bundle - doLast { - plugins = [ - provider(new Callable(){ - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - File dir = new File(bwcFilePath + "/job-scheduler/" + project.version) - if (!dir.exists()) { - dir.mkdirs() - } - File file = new File(dir, "opendistro-reports-scheduler-" + project.version + ".zip") - if (!file.exists()) { - new URL(jobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} - } - return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile() - } - } - } - }), - project.getObjects().fileProperty().value(bundle.getArchiveFile()) - ] - } -} - -// Create two test clusters with 3 nodes of the old version -2.times {i -> - task "${baseName}#oldVersionClusterTask$i"(type: StandaloneRestIntegTestTask) { - dependsOn 'prepareBwcTests' - useCluster testClusters."${baseName}$i" - filter { - includeTestsMatching "org.opensearch.integTest.bwc.*IT" - } - systemProperty 'tests.rest.bwcsuite', 'old_cluster' - systemProperty 'tests.rest.bwcsuite_round', 'old' - systemProperty 'tests.plugin_bwc_version', bwcVersion - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}$i".allHttpSocketURI.join(",")}") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}$i".getName()}") - } -} - -// Upgrade one node of the old cluster to new OpenSearch version with upgraded plugin version. -// This results in a mixed cluster with 2 nodes on the old version and 1 upgraded node. -// This is also used as a one third upgraded cluster for a rolling upgrade. -task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) { - useCluster testClusters."${baseName}0" - dependsOn "${baseName}#oldVersionClusterTask0" - doFirst { - testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) - } - filter { - includeTestsMatching "org.opensearch.integTest.bwc.*IT" - } - systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' - systemProperty 'tests.rest.bwcsuite_round', 'first' - systemProperty 'tests.plugin_bwc_version', bwcVersion - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") -} - -// Upgrade the second node to new OpenSearch version with upgraded plugin version after the first node is upgraded. -// This results in a mixed cluster with 1 node on the old version and 2 upgraded nodes. -// This is used for rolling upgrade. -task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTask) { - dependsOn "${baseName}#mixedClusterTask" - useCluster testClusters."${baseName}0" - doFirst { - testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) - } - filter { - includeTestsMatching "org.opensearch.integTest.bwc.*IT" - } - systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' - systemProperty 'tests.rest.bwcsuite_round', 'second' - systemProperty 'tests.plugin_bwc_version', bwcVersion - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") -} - -// Upgrade the third node to new OpenSearch version with upgraded plugin version after the second node is upgraded. -// This results in a fully upgraded cluster. -// This is used for rolling upgrade. -task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) { - dependsOn "${baseName}#twoThirdsUpgradedClusterTask" - useCluster testClusters."${baseName}0" - doFirst { - testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) - } - filter { - includeTestsMatching "org.opensearch.integTest.bwc.*IT" - } - mustRunAfter "${baseName}#mixedClusterTask" - systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' - systemProperty 'tests.rest.bwcsuite_round', 'third' - systemProperty 'tests.plugin_bwc_version', bwcVersion - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") -} - -// Upgrade all the nodes of the old cluster to new OpenSearch version with upgraded plugin version -// at the same time resulting in a fully upgraded cluster. -task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) { - dependsOn "${baseName}#oldVersionClusterTask1" - useCluster testClusters."${baseName}1" - doFirst { - testClusters."${baseName}1".upgradeAllNodesAndPluginsToNextVersion(plugins) - } - filter { - includeTestsMatching "org.opensearch.integTest.bwc.*IT" - } - systemProperty 'tests.rest.bwcsuite', 'upgraded_cluster' - systemProperty 'tests.plugin_bwc_version', bwcVersion - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}1".allHttpSocketURI.join(",")}") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}1".getName()}") -} - -// A bwc test suite which runs all the bwc tasks combined -task bwcTestSuite(type: StandaloneRestIntegTestTask) { - exclude '**/*Test*' - exclude '**/*IT*' - dependsOn tasks.named("${baseName}#mixedClusterTask") - dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask") - dependsOn tasks.named("${baseName}#fullRestartClusterTask") -} - task integTestRemote(type: RestIntegTestTask) { testClassesDirs = sourceSets.test.output.classesDirs classpath = sourceSets.test.runtimeClasspath From dddb0d00e12da1b995e0dc9243d8269d86075999 Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Fri, 5 Aug 2022 17:11:38 -0700 Subject: [PATCH 2/5] removed bwc test from workflows Signed-off-by: Shenoy Pratik --- .../reports-scheduler-test-and-build-workflow.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml index 2e78ad08..eaec60d8 100644 --- a/.github/workflows/reports-scheduler-test-and-build-workflow.yml +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -21,13 +21,6 @@ jobs: - name: Checkout Reports Scheduler uses: actions/checkout@v2 - - name: RunBackwards Compatibility Tests - run: | - cd reports-scheduler - echo "Running backwards compatibility tests ..." - ./gradlew bwcTestSuite - - - name: Build with Gradle run: | cd reports-scheduler @@ -50,4 +43,3 @@ jobs: with: name: reports-scheduler path: reports-scheduler-builds - From 285f3018ea466c3ef120365888ed051875f9a74c Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Fri, 5 Aug 2022 17:57:06 -0700 Subject: [PATCH 3/5] updating bwc with OS 1.1 Signed-off-by: Shenoy Pratik --- ...orts-scheduler-test-and-build-workflow.yml | 6 + reports-scheduler/build.gradle | 188 ++++++++++++++++++ 2 files changed, 194 insertions(+) diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml index eaec60d8..4c4a4844 100644 --- a/.github/workflows/reports-scheduler-test-and-build-workflow.yml +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -21,6 +21,12 @@ jobs: - name: Checkout Reports Scheduler uses: actions/checkout@v2 + - name: RunBackwards Compatibility Tests + run: | + cd reports-scheduler + echo "Running backwards compatibility tests ..." + ./gradlew bwcTestSuite + - name: Build with Gradle run: | cd reports-scheduler diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index df277e1d..2ca7b79a 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -315,6 +315,194 @@ testClusters.integTest { setting 'path.repo', repo.absolutePath } +// For job-scheduler and reports-scheduler, the latest opensearch releases appear to be 1.1.0.0. +String bwcVersion = "1.1.0.0" +String baseName = "reportsSchedulerBwcCluster" +String bwcFilePath = "src/test/resources/bwc" +String bwcJobSchedulerURL = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/opensearch-job-scheduler-1.1.0.0.zip" +String bwcReportsSchedulerURL = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/opensearch-reports-scheduler-1.1.0.0.zip" + +2.times {i -> + testClusters { + "${baseName}$i" { + testDistribution = "ARCHIVE" + versions = ["7.10.2", opensearch_version] + numberOfNodes = 3 + plugin(provider(new Callable(){ + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + File dir = new File(bwcFilePath + "/job-scheduler/" + bwcVersion) + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-job-scheduler-" + bwcVersion + ".zip") + if (!file.exists()) { + new URL(bwcJobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } + return fileTree(bwcFilePath + "/job-scheduler/" + bwcVersion).getSingleFile() + } + } + } + })) + plugin(provider(new Callable(){ + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + File dir = new File(bwcFilePath + "/reports-scheduler/" + bwcVersion) + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-reports-scheduler-" + bwcVersion + ".zip") + if (!file.exists()) { + new URL(bwcReportsSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } + return fileTree(bwcFilePath + "/reports-scheduler/" + bwcVersion).getSingleFile() + } + } + } + })) + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + setting 'http.content_type.required', 'true' + } + } +} + +List> plugins = [] + +// Ensure the artifact for the current project version is available to be used for the bwc tests +task prepareBwcTests { + dependsOn bundle + doLast { + plugins = [ + provider(new Callable(){ + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + File dir = new File(bwcFilePath + "/job-scheduler/" + project.version) + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-reports-scheduler-" + project.version + ".zip") + if (!file.exists()) { + new URL(jobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } + return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile() + } + } + } + }), + project.getObjects().fileProperty().value(bundle.getArchiveFile()) + ] + } +} + +// Create two test clusters with 3 nodes of the old version +2.times {i -> + task "${baseName}#oldVersionClusterTask$i"(type: StandaloneRestIntegTestTask) { + dependsOn 'prepareBwcTests' + useCluster testClusters."${baseName}$i" + filter { + includeTestsMatching "org.opensearch.integTest.bwc.*IT" + } + systemProperty 'tests.rest.bwcsuite', 'old_cluster' + systemProperty 'tests.rest.bwcsuite_round', 'old' + systemProperty 'tests.plugin_bwc_version', bwcVersion + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}$i".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}$i".getName()}") + } +} + +// Upgrade one node of the old cluster to new OpenSearch version with upgraded plugin version. +// This results in a mixed cluster with 2 nodes on the old version and 1 upgraded node. +// This is also used as a one third upgraded cluster for a rolling upgrade. +task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) { + useCluster testClusters."${baseName}0" + dependsOn "${baseName}#oldVersionClusterTask0" + doFirst { + testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) + } + filter { + includeTestsMatching "org.opensearch.integTest.bwc.*IT" + } + systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' + systemProperty 'tests.rest.bwcsuite_round', 'first' + systemProperty 'tests.plugin_bwc_version', bwcVersion + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") +} + +// Upgrade the second node to new OpenSearch version with upgraded plugin version after the first node is upgraded. +// This results in a mixed cluster with 1 node on the old version and 2 upgraded nodes. +// This is used for rolling upgrade. +task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTask) { + dependsOn "${baseName}#mixedClusterTask" + useCluster testClusters."${baseName}0" + doFirst { + testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) + } + filter { + includeTestsMatching "org.opensearch.integTest.bwc.*IT" + } + systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' + systemProperty 'tests.rest.bwcsuite_round', 'second' + systemProperty 'tests.plugin_bwc_version', bwcVersion + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") +} + +// Upgrade the third node to new OpenSearch version with upgraded plugin version after the second node is upgraded. +// This results in a fully upgraded cluster. +// This is used for rolling upgrade. +task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) { + dependsOn "${baseName}#twoThirdsUpgradedClusterTask" + useCluster testClusters."${baseName}0" + doFirst { + testClusters."${baseName}0".upgradeNodeAndPluginToNextVersion(plugins) + } + filter { + includeTestsMatching "org.opensearch.integTest.bwc.*IT" + } + mustRunAfter "${baseName}#mixedClusterTask" + systemProperty 'tests.rest.bwcsuite', 'mixed_cluster' + systemProperty 'tests.rest.bwcsuite_round', 'third' + systemProperty 'tests.plugin_bwc_version', bwcVersion + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") +} + +// Upgrade all the nodes of the old cluster to new OpenSearch version with upgraded plugin version +// at the same time resulting in a fully upgraded cluster. +task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) { + dependsOn "${baseName}#oldVersionClusterTask1" + useCluster testClusters."${baseName}1" + doFirst { + testClusters."${baseName}1".upgradeAllNodesAndPluginsToNextVersion(plugins) + } + filter { + includeTestsMatching "org.opensearch.integTest.bwc.*IT" + } + systemProperty 'tests.rest.bwcsuite', 'upgraded_cluster' + systemProperty 'tests.plugin_bwc_version', bwcVersion + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}1".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}1".getName()}") +} + +// A bwc test suite which runs all the bwc tasks combined +task bwcTestSuite(type: StandaloneRestIntegTestTask) { + exclude '**/*Test*' + exclude '**/*IT*' + dependsOn tasks.named("${baseName}#mixedClusterTask") + dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask") + dependsOn tasks.named("${baseName}#fullRestartClusterTask") +} + task integTestRemote(type: RestIntegTestTask) { testClassesDirs = sourceSets.test.output.classesDirs classpath = sourceSets.test.runtimeClasspath From 9380085af56f951be498c498e52adf8f0b12d84e Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Fri, 5 Aug 2022 18:00:25 -0700 Subject: [PATCH 4/5] update bwc version Signed-off-by: Shenoy Pratik --- reports-scheduler/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index 2ca7b79a..19179886 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -326,7 +326,7 @@ String bwcReportsSchedulerURL = "https://ci.opensearch.org/ci/dbc/bundle-build/1 testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["7.10.2", opensearch_version] + versions = ["1.1.0", opensearch_version] numberOfNodes = 3 plugin(provider(new Callable(){ @Override From 3909d68d5eb51b7f42ac823dafa3f4e4a39a71c1 Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Fri, 5 Aug 2022 18:11:59 -0700 Subject: [PATCH 5/5] update bwc test plugin names Signed-off-by: Shenoy Pratik --- .../integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt b/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt index c37a396f..78605ff6 100644 --- a/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt +++ b/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt @@ -50,8 +50,8 @@ class ReportsSchedulerBackwardsCompatibilityIT : PluginRestTestCase() { val pluginNames = plugins.map { plugin -> plugin["name"] }.toSet() when (CLUSTER_TYPE) { ClusterType.OLD -> { - assertTrue(pluginNames.contains("opendistro-reports-scheduler")) - assertTrue(pluginNames.contains("opendistro-job-scheduler")) + assertTrue(pluginNames.contains("opensearch-reports-scheduler")) + assertTrue(pluginNames.contains("opensearch-job-scheduler")) createBasicReportDefinition() } ClusterType.MIXED -> {