Skip to content

feat: add wescale wesql cluster workflow #37

feat: add wescale wesql cluster workflow

feat: add wescale wesql cluster workflow #37

name: "Ubuntu Docker Cluster"
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
setup:
name: "Ubuntu Docker Cluster"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Start MySQL Server
run: |
cd ./examples/wesql-server && ./start_mysql_server.sh
- name: Install MySQL client
run: |
sudo apt-get update && sudo apt-get install -y mysql-client
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.1
- name: Compile source
timeout-minutes: 30
run: |
# install etcd
BUILD_CHROME=0 BUILD_JAVA=0 BUILD_CONSUL=0 BUILD_K3S=0 BUILD_ETCD=1 ./bootstrap.sh
make failpoint-enable
make build
make failpoint-disable
- name: Start WeScale
run: |
export PATH=$PATH:$(pwd)/bin
cd ./examples/wesql-server
./init_single_node_cluster.sh 2>&1 | tee init_script_logs.txt &
- name: Check Vitess Tablets
if: always()
run: |
# Attempt to connect and execute command, display logs if failed
if ! mysql -h127.0.0.1 -P15306 -uroot -ppasswd -e "show vitess_tablets"; then
echo "Failed to execute MySQL command"
echo "=== Initialization Script Logs ==="
docker logs mysql-server
cat ./examples/wesql-server/init_script_logs.txt
exit 1
fi
- name: Checkout mysql-tester code
uses: actions/checkout@v2
with:
repository: apecloud/mysql-tester
path: './mysql-tester'
- name: Build mysql-tester
run: |
cd ./mysql-tester && \
mkdir bin && \
make build
- name: Run endtoend test
run: |
cd ./mysql-tester && \
eatmydata -- ./bin/mysql-tester -user root -port 15306 -path testcase/wesql-scale 2>&1 | tee -a output.txt
- name: Print test output
run: |
# print test output
cat ./mysql-tester/output.txt
- name: Check test results
run: |
# check if any test failed
if grep -q -- 'level=error' ./mysql-tester/output.txt; then
echo "Testcase is failed"
exit 1
else
echo "Testcase is successful"
fi