From 5f9555a3c8ac8ee3b34f4a9661e6fbd190f040bc Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Tue, 29 Jun 2021 08:05:18 +0800 Subject: [PATCH] address comment --- .github/workflows/upstream-switch.yml | 4 ++++ tests/_utils/test_prepare | 2 +- tests/downstream_more_column/run.sh | 2 +- tests/upstream_switch/case.sh | 1 + tests/upstream_switch/lib.sh | 5 ----- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/upstream-switch.yml b/.github/workflows/upstream-switch.yml index c28049a4ac..edcf7df623 100644 --- a/.github/workflows/upstream-switch.yml +++ b/.github/workflows/upstream-switch.yml @@ -5,6 +5,10 @@ on: branches: - master - release-2.0 + pull_request: + branches: + - master + - release-2.0 schedule: - cron: '3 22 * * *' # run at minute 06:03 UTC+8 diff --git a/tests/_utils/test_prepare b/tests/_utils/test_prepare index 73eaef1545..e74cea54cb 100644 --- a/tests/_utils/test_prepare +++ b/tests/_utils/test_prepare @@ -279,6 +279,6 @@ function init_cluster(){ } function get_master_status() { - arr=$(echo "show master status;" | MYSQL_PWD=123456 mysql -uroot -h127.0.0.1 -P3306 | awk 'NR==2') + arr=$(echo "show master status;" | MYSQL_PWD=123456 mysql -uroot -h$1 -P3306 | awk 'NR==2') echo $arr } diff --git a/tests/downstream_more_column/run.sh b/tests/downstream_more_column/run.sh index 39a98ee501..dfa6544b2f 100755 --- a/tests/downstream_more_column/run.sh +++ b/tests/downstream_more_column/run.sh @@ -39,7 +39,7 @@ function run() { # start DM task in incremental mode # schemaTracker create table from downstream - master_status=($(get_master_status)) + master_status=($(get_master_status $MYSQL_HOST1)) cp $cur/conf/dm-task-incremental.yaml $WORK_DIR/dm-task-incremental.yaml sed -i "s/binlog-gtid-placeholder/${master_status[2]}/g" $WORK_DIR/dm-task-incremental.yaml run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ diff --git a/tests/upstream_switch/case.sh b/tests/upstream_switch/case.sh index dca13733cd..cc9a3d950d 100644 --- a/tests/upstream_switch/case.sh +++ b/tests/upstream_switch/case.sh @@ -5,6 +5,7 @@ set -eu CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) PATH=$CUR/../_utils:$PATH # for sync_diff_inspector +source $cur/../_utils/test_prepare source $CUR/lib.sh function clean_data() { diff --git a/tests/upstream_switch/lib.sh b/tests/upstream_switch/lib.sh index de3a613d1c..c64d0e923d 100644 --- a/tests/upstream_switch/lib.sh +++ b/tests/upstream_switch/lib.sh @@ -53,11 +53,6 @@ function prepare_less_binlogs() { exec_sql $1 "insert into db2.tb2 values(2),(3);" } -function get_master_status() { - arr=$(echo "show master status;" | MYSQL_PWD=123456 mysql -uroot -h$1 -P3306 | awk 'NR==2') - echo $arr -} - function change_master_to_pos() { exec_sql $1 "stop slave;" echo "change master to master_host='$2',master_user='root',master_password='123456',master_log_file='$3',master_log_pos=$4;"