Skip to content

Commit

Permalink
Enable BWC tests with with OpenSearch 1.1 (#772)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 authored Aug 18, 2022
1 parent 46883a2 commit eeb90cf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 5 additions & 9 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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<RegularFile>() {
@Override
Expand All @@ -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 }}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void testBackwardsCompatibility() throws Exception {
Set<Object> 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);
Expand Down
2 changes: 2 additions & 0 deletions integ-test/src/test/resources/bwc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Empty file modified scripts/bwctest.sh
100644 → 100755
Empty file.

0 comments on commit eeb90cf

Please sign in to comment.