From 3407fdbfdc8652788c99bae3d9d3059433d48548 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Wed, 17 Aug 2022 18:46:56 +0000 Subject: [PATCH] Enable BWC tests with with OpenSearch 1.1 Signed-off-by: Joshua Li --- .github/workflows/sql-test-and-build-workflow.yml | 3 +++ integ-test/build.gradle | 14 +++++--------- .../sql/bwc/SQLBackwardsCompatibilityIT.java | 2 +- integ-test/src/test/resources/bwc/.gitignore | 2 ++ scripts/bwctest.sh | 0 5 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 integ-test/src/test/resources/bwc/.gitignore mode change 100644 => 100755 scripts/bwctest.sh diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index 70d1c3a3e5..fcc63433a8 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -22,6 +22,9 @@ jobs: - name: Build with Gradle run: ./gradlew build assemble + - name: Run backward compatibility tests + run: ./scripts/bwctest.sh + - name: Create Artifact Path run: | mkdir -p opensearch-sql-builds diff --git a/integ-test/build.gradle b/integ-test/build.gradle index 429c360a1b..49d9a754d0 100644 --- a/integ-test/build.gradle +++ b/integ-test/build.gradle @@ -187,21 +187,17 @@ task compileJdbc(type: Exec) { } } -/* -BWC test suite was running on OpenDistro which was discontinued and no available anymore for testing. -Test suite is not removed, because it could be reused later between different OpenSearch versions. -*/ -String bwcVersion = "1.13.2.0"; +String bwcVersion = "1.1.0.0"; String baseName = "sqlBwcCluster" String bwcFilePath = "src/test/resources/bwc/" -String bwcOpenDistroPlugin = "opendistro-sql-" + bwcVersion + ".zip" -String bwcRemoteFile = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-sql/' + bwcOpenDistroPlugin +String bwcSqlPlugin = "opensearch-sql-" + bwcVersion + ".zip" +String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/" + bwcSqlPlugin 2.times { i -> testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["7.10.2", opensearch_version] + versions = ["1.1.0", opensearch_version] numberOfNodes = 3 plugin(provider(new Callable() { @Override @@ -213,7 +209,7 @@ String bwcRemoteFile = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elastics if (!dir.exists()) { dir.mkdirs() } - File f = new File(dir, bwcOpenDistroPlugin) + File f = new File(dir, bwcSqlPlugin) if (!f.exists()) { new URL(bwcRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }} } diff --git a/integ-test/src/test/java/org/opensearch/sql/bwc/SQLBackwardsCompatibilityIT.java b/integ-test/src/test/java/org/opensearch/sql/bwc/SQLBackwardsCompatibilityIT.java index 079980248f..c32a3336c0 100644 --- a/integ-test/src/test/java/org/opensearch/sql/bwc/SQLBackwardsCompatibilityIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/bwc/SQLBackwardsCompatibilityIT.java @@ -96,7 +96,7 @@ public void testBackwardsCompatibility() throws Exception { Set pluginNames = plugins.stream().map(map -> map.get("name")).collect(Collectors.toSet()); switch (CLUSTER_TYPE) { case OLD: - Assert.assertTrue(pluginNames.contains("opendistro-sql")); + Assert.assertTrue(pluginNames.contains("opensearch-sql")); updateLegacySQLSettings(); loadIndex(Index.ACCOUNT); verifySQLQueries(LEGACY_QUERY_API_ENDPOINT); diff --git a/integ-test/src/test/resources/bwc/.gitignore b/integ-test/src/test/resources/bwc/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/integ-test/src/test/resources/bwc/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/scripts/bwctest.sh b/scripts/bwctest.sh old mode 100644 new mode 100755