Skip to content

Commit e5b61d8

Browse files
dveedendvilaverde
authored and
dvilaverde
committed
CI: Add tests for various MySQL versions (go-mysql-org#870)
Co-authored-by: lance6716 <[email protected]> simple metrics to capture packet data size both compressed & uncompressed
1 parent 3e05e20 commit e5b61d8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/ci.yml

+39
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,45 @@ jobs:
4242
go test $(go list ./... | grep -v canal)
4343
go test $(go list ./... | grep canal)
4444
45+
mysqltest:
46+
strategy:
47+
matrix:
48+
mysql_version:
49+
- 8.0.37
50+
- 8.4.0
51+
name: Tests with MySQL ${{ matrix.mysql_version }}
52+
runs-on: ubuntu-latest
53+
services:
54+
mysql:
55+
image: mysql:${{ matrix.mysql_version }}
56+
env:
57+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
58+
ports:
59+
- 3306:3306
60+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
61+
62+
steps:
63+
- name: MySQL versions
64+
run: |
65+
echo -n "mysql -v: " ; mysql -V
66+
echo -n "mysqldump -V: " ; mysqldump -V
67+
echo -n "MySQL Server (SELECT VERSION()): " ; mysql -h 127.0.0.1 -u root -BNe 'SELECT VERSION()'
68+
- name: Prepare for Go
69+
run: |
70+
sudo apt-get install -y make gcc
71+
- name: Checkout code
72+
uses: actions/checkout@v4
73+
- name: Install Go
74+
uses: actions/setup-go@v5
75+
with:
76+
go-version: "1.22"
77+
- name: Run tests
78+
run: |
79+
# separate test to avoid RESET MASTER conflict
80+
# TODO: Fix "dump/" and "canal/": mysqldump tries to run SHOW MASTER STATUS on v8.4.0
81+
go test $(go list ./... | grep -v canal | grep -v dump)
82+
# go test $(go list ./... | grep canal | grep -v dump)
83+
4584
golangci:
4685
name: golangci
4786
runs-on: ubuntu-latest

packet/conn.go

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ type Conn struct {
7171
Stats *Stats
7272

7373
compressedReaderActive bool
74+
75+
Stats *Stats
7476
}
7577

7678
func NewConn(conn net.Conn) *Conn {

0 commit comments

Comments
 (0)