-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add backwards compatibility tests for SQL (#322)
* Add bwc tests setup Signed-off-by: Joshua Li <joshuali925@gmail.com> * update setup Signed-off-by: Joshua Li <joshuali925@gmail.com> * Use only 1 cluster Signed-off-by: Joshua Li <joshuali925@gmail.com> * Use 2 clusters Signed-off-by: Joshua Li <joshuali925@gmail.com> * Add 1.2 snapshot Signed-off-by: Joshua Li <joshuali925@gmail.com> * Fix test setup Signed-off-by: Joshua Li <joshuali925@gmail.com> * Add sql bwc tests for queries and cluster settings Signed-off-by: Joshua Li <joshuali925@gmail.com> * Add bwc test script and remove latest artifact Signed-off-by: Joshua Li <joshuali925@gmail.com> * Format code Signed-off-by: Joshua Li <joshuali925@gmail.com> * Fix indentation Signed-off-by: Joshua Li <joshuali925@gmail.com> * Add bwc tests to CI Signed-off-by: Joshua Li <joshuali925@gmail.com> * Bump bwc to 1.2.1-SNAPSHOT Signed-off-by: Joshua Li <joshuali925@gmail.com>
- Loading branch information
1 parent
53c236f
commit 1dfaa1b
Showing
8 changed files
with
468 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function usage() { | ||
echo "" | ||
echo "This script is used to run Backwards Compatibility tests" | ||
echo "--------------------------------------------------------------------------" | ||
echo "Usage: $0 [args]" | ||
echo "" | ||
echo "Required arguments:" | ||
echo "None" | ||
echo "" | ||
echo -e "-h\tPrint this message." | ||
echo "--------------------------------------------------------------------------" | ||
} | ||
|
||
while getopts ":h" arg; do | ||
case $arg in | ||
h) | ||
usage | ||
exit 1 | ||
;; | ||
?) | ||
echo "Invalid option: -${OPTARG}" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Place SQL artifact for the current version for bwc | ||
function setup_bwc_artifact() { | ||
# This gets opensearch version from build.gradle (e.g. 1.2.0-SNAPSHOT), | ||
# then converts to plugin version by appending ".0" (e.g. 1.2.0.0-SNAPSHOT), | ||
# assuming one line in build.gradle is 'opensearch_version= System.getProperty("opensearch.version", "<opensearch_version>")'. | ||
plugin_version=$(grep 'opensearch_version = System.getProperty' build.gradle | \ | ||
grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+[^"]*' | sed -e 's/\([0-9]\)\([^0-9]*\)$/\1.0\2/') | ||
plugin_artifact="./plugin/build/distributions/opensearch-sql-$plugin_version.zip" | ||
bwc_artifact_dir="./integ-test/src/test/resources/bwc/$plugin_version" | ||
|
||
if [ -z "${plugin_version// }" ]; then | ||
echo "Error: failed to retrieve plugin version from build.gradle." >&2 | ||
exit 1 | ||
fi | ||
|
||
# copy current artifact to bwc artifact directory if it's not there | ||
if [ ! -f "$bwc_artifact_dir/opensearch-sql-$plugin_version.zip" ]; then | ||
if [ ! -f "$plugin_artifact" ]; then | ||
./gradlew assemble | ||
fi | ||
mkdir -p "$bwc_artifact_dir" | ||
cp "$plugin_artifact" "$bwc_artifact_dir" | ||
fi | ||
} | ||
|
||
setup_bwc_artifact | ||
./gradlew bwcTestSuite -Dtests.security.manager=false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# This file is generated by the 'io.freefair.lombok' Gradle plugin | ||
config.stopBubbling = true | ||
lombok.addLombokGeneratedAnnotation = true |
Oops, something went wrong.