diff --git a/.github/workflows/test_bwc.yml b/.github/workflows/test_bwc.yml index d7aa2328d..d4a81cdce 100644 --- a/.github/workflows/test_bwc.yml +++ b/.github/workflows/test_bwc.yml @@ -42,4 +42,4 @@ jobs: - name: Run AD Backwards Compatibility Tests run: | echo "Running backwards compatibility tests ..." - ./gradlew bwcTestSuite -Dtests.security.manager=false + ./gradlew bwcTestSuite -Dtests.security.manager=false -i diff --git a/build.gradle b/build.gradle index 8102e1b20..22617e570 100644 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,7 @@ * GitHub history for details. */ +import java.nio.file.Paths import java.util.concurrent.Callable import org.opensearch.gradle.test.RestIntegTestTask import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -35,12 +36,8 @@ buildscript { js_resource_folder = "src/test/resources/job-scheduler" common_utils_version = System.getProperty("common_utils.version", opensearch_build) job_scheduler_version = System.getProperty("job_scheduler.version", opensearch_build) - bwcVersionShort = "2.10.0" - bwcVersion = bwcVersionShort + ".0" - bwcOpenSearchADDownload = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' + - 'opensearch/plugins/opensearch-anomaly-detection-' + bwcVersion + '.zip' - bwcOpenSearchJSDownload = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' + - 'opensearch/plugins/opensearch-job-scheduler-' + bwcVersion + '.zip' + bwcVersionShort = "2.11.0" + bwcVersion = bwcVersionShort + ".0-SNAPSHOT" baseName = "adBwcCluster" bwcFilePath = "src/test/resources/org/opensearch/ad/bwc/" bwcJobSchedulerPath = bwcFilePath + "job-scheduler/" @@ -65,12 +62,32 @@ buildscript { } plugins { + id "de.undercouch.download" version "5.3.0" id 'com.netflix.nebula.ospackage' version "11.0.0" id "com.diffplug.spotless" version "6.18.0" id 'java-library' id 'org.gradle.test-retry' version '1.5.4' } +ext { + getPluginDownloadLink = { plugin, version -> + var repo = "https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/" + + "opensearch-$plugin/$version/" + var metadataFile = Paths.get(projectDir.toString(), "build", "maven-metadata.xml").toAbsolutePath().toFile() + download.run { + src repo + "maven-metadata.xml" + dest metadataFile + } + def metadata = new XmlParser().parse(metadataFile) + def securitySnapshotVersion = metadata.versioning.snapshotVersions[0].snapshotVersion[0].value[0].text() + + return repo + "opensearch-$plugin-${securitySnapshotVersion}.zip" + } + + bwcOpenSearchADDownload = getPluginDownloadLink('anomaly-detection', bwcVersion) + bwcOpenSearchJSDownload = getPluginDownloadLink('job-scheduler', bwcVersion) +} + tasks.withType(JavaCompile) { options.encoding = "UTF-8" } @@ -501,6 +518,10 @@ task integTestRemote(type: RestIntegTestTask) { } } })) + nodes.each { node -> + node.setting("network.bind_host", "127.0.0.1") + node.setting("network.publish_host", "127.0.0.1") + } setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" setting 'http.content_type.required', 'true' } diff --git a/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java b/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java index 0f513b502..8d444c395 100644 --- a/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java +++ b/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java @@ -167,7 +167,7 @@ public void testBackwardsCompatibility() throws Exception { case MIXED: // TODO: We have no way to specify whether send request to old node or new node now. // Add more test later when it's possible to specify request node. - Assert.assertTrue(pluginNames.contains("opensearch-anomaly-detection")); + Assert.assertTrue(pluginNames.contains("opensearch-anomaly-detection") || pluginNames.contains("opensearch-time-series-analytics")); Assert.assertTrue(pluginNames.contains("opensearch-job-scheduler")); // Create single entity detector and start realtime job