Skip to content

Commit

Permalink
fix(test): fix version sort and handle case where release branch is c…
Browse files Browse the repository at this point in the history
…urrent branch (#18562)
  • Loading branch information
kwannoel authored Sep 17, 2024
1 parent 1c04a5c commit 2b9280f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ci/scripts/backwards-compat-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 13 additions & 4 deletions e2e_test/backwards-compat-tests/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2b9280f

Please sign in to comment.