From 2b9280f2333ac857864bf510158f34ee79fa6b51 Mon Sep 17 00:00:00 2001 From: Noel Kwan <47273164+kwannoel@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:16:01 +0800 Subject: [PATCH] fix(test): fix version sort and handle case where release branch is current branch (#18562) --- ci/scripts/backwards-compat-test.sh | 6 ++++++ .../backwards-compat-tests/scripts/utils.sh | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ci/scripts/backwards-compat-test.sh b/ci/scripts/backwards-compat-test.sh index 90a01f57a51cc..c077d3d360eb2 100755 --- a/ci/scripts/backwards-compat-test.sh +++ b/ci/scripts/backwards-compat-test.sh @@ -79,6 +79,8 @@ ENABLE_BUILD_RUST=$ENABLE_BUILD # Use target/debug for simplicity. ENABLE_RELEASE_PROFILE=false +ENABLE_PYTHON_UDF=true +ENABLE_JS_UDF=true EOF # See https://github.com/risingwavelabs/risingwave/pull/15448 @@ -100,6 +102,10 @@ setup_old_cluster() { set -e echo "Failed to download ${OLD_VERSION} from github releases, build from source later during \`risedev d\`" configure_rw "$OLD_VERSION" true + elif [[ $OLD_VERSION = '1.10.1' || $OLD_VERSION = '1.10.0' ]]; then + set -e + echo "1.10.x has older openssl version, build from source later during \`risedev d\`" + configure_rw "$OLD_VERSION" true else set -e tar -xvf risingwave-v"${OLD_VERSION}"-x86_64-unknown-linux.tar.gz diff --git a/e2e_test/backwards-compat-tests/scripts/utils.sh b/e2e_test/backwards-compat-tests/scripts/utils.sh index 8f41dad0860f1..f66e7518df2ef 100644 --- a/e2e_test/backwards-compat-tests/scripts/utils.sh +++ b/e2e_test/backwards-compat-tests/scripts/utils.sh @@ -69,7 +69,7 @@ check_version() { local VERSION=$1 local raw_version=$(run_sql "SELECT version();") echo "--- Version" - echo "$raw_version" + echo "raw_version: $raw_version" local version=$(echo $raw_version | grep -i risingwave | sed 's/^.*risingwave-\([0-9]*\.[0-9]*\.[0-9]\).*$/\1/i') if [[ "$version" != "$VERSION" ]]; then echo "Version mismatch, expected $VERSION, got $version" @@ -133,9 +133,18 @@ get_old_version() { # Then we sort them in descending order. echo "--- VERSIONS" - local sorted_versions=$(echo -e "$tags" | sort -t '.' -n) + local sorted_versions=$(echo -e "$tags" | sort -V) echo "$sorted_versions" + # We handle the edge case where the current branch is the one being released. + # If so, we need to prune it from the list. + local current_branch=$(git branch --show-current | tr -d 'v') + echo "--- CURRENT BRANCH: $current_branch" + + echo "--- PRUNED VERSIONS" + local pruned_versions=$(echo -e "$sorted_versions" | grep -v "$current_branch") + echo "$pruned_versions" + # Then we take the Nth latest version. # We set $OLD_VERSION to this. OLD_VERSION=$(echo -e "$sorted_versions" | tail -n $VERSION_OFFSET | head -1) @@ -182,7 +191,7 @@ seed_old_cluster() { cp -r e2e_test/tpch/* $TEST_DIR/tpch ./risedev clean-data - ./risedev d full-without-monitoring && rm .risingwave/log/* + ENABLE_PYTHON_UDF=1 ENABLE_JS_UDF=1 ./risedev d full-without-monitoring && rm .risingwave/log/* check_version "$OLD_VERSION" @@ -240,7 +249,7 @@ seed_old_cluster() { validate_new_cluster() { echo "--- Start cluster on latest" - ./risedev d full-without-monitoring + ENABLE_PYTHON_UDF=1 ENABLE_JS_UDF=1 ./risedev d full-without-monitoring echo "--- Wait ${RECOVERY_DURATION}s for Recovery on Old Cluster Data" sleep $RECOVERY_DURATION