This is an automated email from the ASF dual-hosted git repository.
sunnianjun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shardingsphere-on-cloud.git
The following commit(s) were added to refs/heads/main by this push:
new 8eba404 fix(ci): fix mysql action in proxy and operator it workflow
(#68)
8eba404 is described below
commit 8eba4045e4bc53b45cc19f4758985ba6ca821a25
Author: liyao <[email protected]>
AuthorDate: Sat Oct 1 20:52:56 2022 +0800
fix(ci): fix mysql action in proxy and operator it workflow (#68)
* chore(ci): add framework for operator integration
Signed-off-by: mlycore <[email protected]>
* chore(ci): add test mysql for operator test
Signed-off-by: mlycore <[email protected]>
* chore(ci): add action installation of MySQL
Signed-off-by: mlycore <[email protected]>
* chore(ci): update mysql installation cmd
Signed-off-by: mlycore <[email protected]>
* chore(ci): add sudo for test
Signed-off-by: mlycore <[email protected]>
* chore(ci): fix package name
Signed-off-by: mlycore <[email protected]>
* fix(ci): fix MySQL client
Signed-off-by: mlycore <[email protected]>
Signed-off-by: mlycore <[email protected]>
---
.github/workflows/operator-integration.yml | 31 ++++++++++++++++++++++++------
.github/workflows/proxy-integration.yml | 6 ++----
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/operator-integration.yml
b/.github/workflows/operator-integration.yml
index e994155..cc2a248 100644
--- a/.github/workflows/operator-integration.yml
+++ b/.github/workflows/operator-integration.yml
@@ -55,9 +55,28 @@ jobs:
kubectl get svc -n shardingsphere --show-labels
kubectl port-forward svc/shardingsphere-cluster 3307:3307 -n
shardingsphere &
sleep 3
- - name: "prepare mysql"
- uses: shogo82148/actions-setup-mysql@v1
- with:
- mysql-version: '5.7'
- - name: "run basic cmd test"
- run: mysql -h127.0.0.1 -P3307 -uroot -proot -e 'SHOW DATABASES'
+ - name: "Prepare MySQL for ShardingSphere Proxy test"
+ run: |
+ set -x
+ kubectl apply -f hack/kubernetes/mysql.yml
+ sleep 60
+ kubectl get pod,svc -n default --show-labels
+ kubectl wait --timeout=60s --for=condition=Ready --all pod -n
default
+ kubectl get pod,svc -n default --show-labels
+ kubectl port-forward svc/mysql-1 3316:3306 -n default &
+ kubectl port-forward svc/mysql-2 3326:3306 -n default &
+ sleep 3
+ - name: "Install MySQL"
+ run: "sudo apt-get install -y mysql-client"
+ - name: "Create schema from MySQL-1"
+ run: mysql -h127.0.0.1 -P3316 -uroot -proot -e 'CREATE DATABASE ds_1;'
+ - name: "Create schema from MySQL-2"
+ run: mysql -h127.0.0.1 -P3326 -uroot -proot -e 'CREATE DATABASE ds_2;'
+ - name: "Create sharding db"
+ run: mysql -h127.0.0.1 -P3307 -uroot -proot -e 'CREATE DATABASE
sharding_db; USE sharding_db;ADD RESOURCE ds_0
(HOST="mysql-1.default",PORT=3306,DB="ds_1",USER="root",PASSWORD="root"),ds_1
(HOST="mysql-2.default",PORT=3306,DB="ds_2",USER="root",PASSWORD="root");CREATE
SHARDING TABLE RULE
t_order(RESOURCES(ds_0,ds_1),SHARDING_COLUMN=order_id,TYPE(NAME="hash_mod",PROPERTIES("sharding-count"="2")),KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME="snowflake")));CREATE
TABLE `t_order` [...]
+ - name: "Query data from sharding_db"
+ run: mysql -h127.0.0.1 -P3307 -uroot -proot -e 'USE sharding_db;SELECT
* FROM t_order;'
+ - name: "Query data from MySQL-1"
+ run: mysql -h127.0.0.1 -P3316 -uroot -proot -e 'USE ds_1;SELECT * FROM
`t_order_0`;'
+ - name: "Query data from MySQL-2 "
+ run: mysql -h127.0.0.1 -P3326 -uroot -proot -e 'USE ds_2;SELECT * FROM
`t_order_1`;'
diff --git a/.github/workflows/proxy-integration.yml
b/.github/workflows/proxy-integration.yml
index dd92f14..d0bf4f0 100644
--- a/.github/workflows/proxy-integration.yml
+++ b/.github/workflows/proxy-integration.yml
@@ -55,10 +55,8 @@ jobs:
kubectl port-forward svc/mysql-1 3316:3306 -n default &
kubectl port-forward svc/mysql-2 3326:3306 -n default &
sleep 3
- - name: "Prepare mysql"
- uses: shogo82148/actions-setup-mysql@v1
- with:
- mysql-version: '5.7'
+ - name: "Install MySQL"
+ run: "sudo apt-get install -y mysql-client"
- name: "Create schema from MySQL-1"
run: mysql -h127.0.0.1 -P3316 -uroot -proot -e 'CREATE DATABASE ds_1;'
- name: "Create schema from MySQL-2"