Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove committed Apr 6, 2021
1 parent 038501a commit 0cc9d28
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/tiup-playground/test_playground.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ function kill_all() {
killall -9 grafana-server || true
killall -9 tiup-playground || true
killall -9 prometheus || true
cat $outfile
}

outfile=/tmp/tiup-playground-test.out
tiup-playground v4.0.10 --tiflash 0 > $outfile 2>&1 &
tiup-playground nightly > $outfile 2>&1 &

# wait $outfile generated
sleep 3

trap "kill_all > /dev/null 2>&1" EXIT
trap "kill_all" EXIT

# wait start cluster successfully
timeout 300 grep -q "CLUSTER START SUCCESSFULLY" <(tail -f $outfile)
Expand Down Expand Up @@ -97,4 +98,17 @@ tiup-playground display | grep -E "terminated|exit" | wc -l | grep -q "1"

killall -2 tiup-playground.test || killall -2 tiup-playground

sleep 60

# test restart with same data
tiup-playground nightly > $outfile 2>&1 &

# wait $outfile generated
sleep 3

# wait start cluster successfully
timeout 300 grep -q "CLUSTER START SUCCESSFULLY" <(tail -f $outfile)

cat $outfile | grep ":3930" | grep -q "Done"

echo -e "\033[0;36m<<< Run all test success >>>\033[0m"

0 comments on commit 0cc9d28

Please sign in to comment.