forked from pingcap/tiflow
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (106 loc) · 4.59 KB
/
dm_binlog_999999.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: DM Binlog 999999
on:
schedule:
- cron: '0 17-23 * * *' # run at minute 0 every hour from 01:00 ~ 07:00 UTC+8
workflow_dispatch:
inputs:
pr:
description: 'Which PR do you want to trigger'
required: true
default: ''
jobs:
test-binlog-999999:
name: Test binlog 999999
runs-on: ubuntu-20.04
steps:
- name: Set up Go env
uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: Check out code
uses: actions/checkout@v2
- name: Check out code by workflow dispatch
if: ${{ github.event.inputs.pr != '' }}
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.pr }}/head
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-ticdc-${{ hashFiles('go.sum') }}
- name: Cache Tools
id: cache-tools
uses: actions/cache@v2
with:
path: tools/bin
key: ${{ runner.os }}-ticdc-tools-${{ hashFiles('tools/check/go.sum') }}
- name: Build DM binary
run: make dm_integration_test_build
- name: Setup CI environment
run: |
docker-compose -f ./dm/tests/binlog_999999/docker-compose.yml up -d
curl http://download.pingcap.org/tidb-enterprise-tools-nightly-linux-amd64.tar.gz | tar xz
mv tidb-enterprise-tools-nightly-linux-amd64/bin/sync_diff_inspector bin/
curl http://download.pingcap.org/tidb-nightly-linux-amd64.tar.gz | tar xz
mv tidb-nightly-linux-amd64/bin/tidb-server bin/
curl -O https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
mv minio bin/
- name: change binlog sequence number to 999998
run: |
while ! mysqladmin -h127.0.0.1 -P3306 -p123456 -uroot ping --connect-timeout=1 > /dev/null 2>&1 ; do
echo "wait mysql"
sleep 1
done
while ! mysqladmin -h127.0.0.1 -P3307 -p123456 -uroot ping --connect-timeout=1 > /dev/null 2>&1 ; do
echo "wait mysql"
sleep 1
done
echo "reset master;" | mysql -uroot -h127.0.0.1 -P3306 -p123456
echo "reset master;" | mysql -uroot -h127.0.0.1 -P3307 -p123456
docker-compose -f ./dm/tests/binlog_999999/docker-compose.yml down
sudo mv /tmp/mysql1-data/mysql-bin.000001 /tmp/mysql1-data/mysql-bin.999998
sudo bash -c "echo './mysql-bin.999998' > /tmp/mysql1-data/mysql-bin.index"
sudo mv /tmp/mysql2-data/mysql-bin.000001 /tmp/mysql2-data/mysql-bin.999998
sudo bash -c "echo './mysql-bin.999998' > /tmp/mysql2-data/mysql-bin.index"
docker-compose -f ./dm/tests/binlog_999999/docker-compose.yml up -d
while ! mysqladmin -h127.0.0.1 -P3306 -p123456 -uroot ping --connect-timeout=1 > /dev/null 2>&1 ; do
echo "wait mysql"
sleep 1
done
while ! mysqladmin -h127.0.0.1 -P3307 -p123456 -uroot ping --connect-timeout=1 > /dev/null 2>&1 ; do
echo "wait mysql"
sleep 1
done
- name: Run test cases
run: |
RESET_MASTER=false make dm_integration_test CASE=incremental_mode
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3306 -p123456 | grep -q "mysql-bin.1000000"
echo "show binary logs;" | mysql -uroot -h127.0.0.1 -P3307 -p123456 | grep -q "mysql-bin.1000000"
- name: Copy logs to hack permission
if: ${{ always() }}
run: |
mkdir ./logs
sudo cp -r -L /tmp/dm_test/incremental_mode/master/log ./logs/master
sudo cp -r -L /tmp/dm_test/incremental_mode/worker1/log ./logs/worker1
sudo cp -r -L /tmp/dm_test/incremental_mode/worker2/log ./logs/worker2
sudo chown -R runner ./logs
# Update logs as artifact seems not stable, so we set `continue-on-error: true` here.
- name: Upload logs
continue-on-error: true
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: test-binlog-999999
path: |
./logs
# send Slack notify if failed.
# NOTE: With the exception of `GITHUB_TOKEN`, secrets are not passed to the runner when a workflow is triggered from a forked repository.
- name: Slack notification
if: ${{ failure() }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFY }}
uses: Ilshidur/action-slack@2.1.0
with:
args: "binlog 999999 failed, see https://github.com/pingcap/tiflow/actions/runs/{{ GITHUB_RUN_ID }}"