Skip to content

Commit 084daa8

Browse files
authored
test: Add nexmark test, kafka test for backwards compatibility testing (risingwavelabs#10413)
1 parent 3c19064 commit 084daa8

23 files changed

+756
-203
lines changed

Makefile.toml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,53 @@ description = "Kill RisingWave dev cluster"
579579
script = '''
580580
#!/usr/bin/env bash
581581
582-
tmux list-windows -t risedev -F "#{pane_id}" | xargs -I {} tmux send-keys -t {} C-c C-d
582+
set -euo pipefail
583+
584+
wait_kafka_exit() {
585+
# Follow kafka-server-stop.sh
586+
while [[ -n "$(ps ax | grep ' kafka\.Kafka ' | grep java | grep -v grep | awk '{print $1}')" ]]; do
587+
echo "Waiting for kafka to exit"
588+
sleep 1
589+
done
590+
}
591+
592+
wait_zookeeper_exit() {
593+
# Follow zookeeper-server-stop.sh
594+
while [[ -n "$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}')" ]]; do
595+
echo "Waiting for zookeeper to exit"
596+
sleep 1
597+
done
598+
}
599+
600+
kill_kafka() {
601+
${PREFIX_BIN}/kafka/bin/kafka-server-stop.sh
602+
wait_kafka_exit
603+
}
604+
605+
kill_zookeeper() {
606+
${PREFIX_BIN}/kafka/bin/zookeeper-server-stop.sh
607+
wait_zookeeper_exit
608+
}
609+
610+
# Kill other components
611+
tmux list-windows -t risedev -F "#{window_name} #{pane_id}" \
612+
| grep -v 'kafka' \
613+
| grep -v 'zookeeper' \
614+
| awk '{ print $2 }' \
615+
| xargs -I {} tmux send-keys -t {} C-c C-d
616+
617+
if [[ -n $(tmux list-windows -t risedev | grep kafka) ]];
618+
then
619+
echo "kill kafka"
620+
kill_kafka
621+
622+
echo "kill zookeeper"
623+
kill_zookeeper
624+
625+
# Kill their tmux sessions
626+
tmux list-windows -t risedev -F "#{pane_id}" | xargs -I {} tmux send-keys -t {} C-c C-d
627+
fi
628+
583629
tmux kill-session -t risedev
584630
test $? -eq 0 || { echo "Failed to stop all RiseDev components."; exit 1; }
585631
'''
@@ -1238,3 +1284,8 @@ cat << EOF > src/config/example.toml
12381284
EOF
12391285
cargo run -p risingwave_common --bin example-config >> src/config/example.toml
12401286
'''
1287+
1288+
[tasks.backwards-compat-test]
1289+
category = "RiseDev - Backwards Compatibility Test"
1290+
description = "Run backwards compatibility test"
1291+
script = "./backwards-compat-tests/scripts/run_local.sh"

backwards-compat-tests/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Backwards Compatibility Tests
2+
3+
The backwards compatibility tests run in the following manner:
4+
1. Prepare old-cluster artifacts
5+
2. Configure the old-cluster.
6+
3. Start the old-cluster.
7+
4. Run DDL / DML / DQL.
8+
5. Stop the old-cluster.
9+
6. Prepare new-cluster artifacts.
10+
7. Configure the new-cluster.
11+
8. Start the new-cluster.
12+
9. Verify results of step 4.
13+
14+
We currently cover the following:
15+
1. Basic mv
16+
2. Nexmark (on rw table not nexmark source)
17+
3. TPC-H
18+
4. Kafka Source
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
ORIGINAL_BRANCH=$(git branch --show-current)
6+
7+
on_exit() {
8+
git checkout "$ORIGINAL_BRANCH"
9+
}
10+
11+
trap on_exit EXIT
12+
13+
source backwards-compat-tests/scripts/utils.sh
14+
15+
configure_rw() {
16+
echo "--- Setting up cluster config"
17+
cat <<EOF > risedev-profiles.user.yml
18+
full-without-monitoring:
19+
steps:
20+
- use: minio
21+
- use: etcd
22+
- use: meta-node
23+
- use: compute-node
24+
- use: frontend
25+
- use: compactor
26+
- use: zookeeper
27+
- use: kafka
28+
EOF
29+
30+
cat <<EOF > risedev-components.user.env
31+
RISEDEV_CONFIGURED=false
32+
33+
ENABLE_MINIO=true
34+
ENABLE_ETCD=true
35+
ENABLE_KAFKA=true
36+
37+
# Fetch risingwave binary from release.
38+
ENABLE_BUILD_RUST=true
39+
40+
# Ensure it will link the all-in-one binary from our release.
41+
ENABLE_ALL_IN_ONE=true
42+
43+
# ENABLE_RELEASE_PROFILE=true
44+
EOF
45+
}
46+
47+
setup_old_cluster() {
48+
echo "--- Setting up old cluster"
49+
git checkout "v${OLD_VERSION}-rc"
50+
}
51+
52+
setup_new_cluster() {
53+
echo "--- Setting up new cluster"
54+
rm -r .risingwave/bin/risingwave
55+
git checkout main
56+
}
57+
58+
main() {
59+
set -euo pipefail
60+
get_rw_versions
61+
setup_old_cluster
62+
configure_rw
63+
seed_old_cluster "$OLD_VERSION"
64+
65+
setup_new_cluster
66+
configure_rw
67+
validate_new_cluster "$NEW_VERSION"
68+
}
69+
70+
main

0 commit comments

Comments
 (0)