File tree 3 files changed +30
-2
lines changed
3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 17
17
echo -n "mysqldump -V: " ; mysqldump -V
18
18
19
19
echo -e '[mysqld]\nserver-id=1\nlog-bin=mysql\nbinlog-format=row\ngtid-mode=ON\nenforce_gtid_consistency=ON\n' | sudo tee /etc/mysql/conf.d/replication.cnf
20
+
21
+ # bind to :: for dual-stack listening
22
+ sudo sed -i 's/bind-address.*= 127.0.0.1/bind-address = ::/' /etc/mysql/mysql.conf.d/mysqld.cnf
23
+ sudo sed -i 's/mysqlx-bind-address.*= 127.0.0.1/mysqlx-bind-address = ::/' /etc/mysql/mysql.conf.d/mysqld.cnf
24
+
20
25
sudo service mysql start
21
26
22
27
# apply this for mysql5 & mysql8 compatibility
29
34
mysql -e "SHOW VARIABLES LIKE 'log_bin'" -uroot
30
35
- name : Prepare for Go
31
36
run : |
32
- sudo apt-get install -y make gcc
37
+ sudo apt-get install -y make gcc lsof
33
38
- name : Checkout code
34
39
uses : actions/checkout@v4
35
40
- name : Install Go
@@ -109,5 +114,6 @@ jobs:
109
114
uses : actions/setup-go@v5
110
115
with :
111
116
go-version : " 1.22"
117
+
112
118
- name : Build on ${{ matrix.os }}/${{ matrix.arch }}
113
119
run : GOARCH=${{ matrix.arch }} GOOS=${{ matrix.os }} go build ./...
Original file line number Diff line number Diff line change @@ -16,12 +16,30 @@ import (
16
16
)
17
17
18
18
type canalTestSuite struct {
19
+ addr string
19
20
suite.Suite
20
21
c * Canal
21
22
}
22
23
24
+ type canalTestSuiteOption func (c * canalTestSuite )
25
+
26
+ func withAddr (addr string ) canalTestSuiteOption {
27
+ return func (c * canalTestSuite ) {
28
+ c .addr = addr
29
+ }
30
+ }
31
+
32
+ func newCanalTestSuite (opts ... canalTestSuiteOption ) * canalTestSuite {
33
+ c := new (canalTestSuite )
34
+ for _ , opt := range opts {
35
+ opt (c )
36
+ }
37
+ return c
38
+ }
39
+
23
40
func TestCanalSuite (t * testing.T ) {
24
- suite .Run (t , new (canalTestSuite ))
41
+ suite .Run (t , newCanalTestSuite ())
42
+ suite .Run (t , newCanalTestSuite (withAddr (mysql .DEFAULT_IPv6_ADDR )))
25
43
}
26
44
27
45
const (
@@ -37,6 +55,9 @@ const (
37
55
func (s * canalTestSuite ) SetupSuite () {
38
56
cfg := NewDefaultConfig ()
39
57
cfg .Addr = fmt .Sprintf ("%s:%s" , * test_util .MysqlHost , * test_util .MysqlPort )
58
+ if s .addr != "" {
59
+ cfg .Addr = s .addr
60
+ }
40
61
cfg .User = "root"
41
62
cfg .HeartbeatPeriod = 200 * time .Millisecond
42
63
cfg .ReadTimeout = 300 * time .Millisecond
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ const (
172
172
173
173
const (
174
174
DEFAULT_ADDR = "127.0.0.1:3306"
175
+ DEFAULT_IPv6_ADDR = "[::1]:3306"
175
176
DEFAULT_USER = "root"
176
177
DEFAULT_PASSWORD = ""
177
178
DEFAULT_FLAVOR = "mysql"
You can’t perform that action at this time.
0 commit comments