Skip to content

Commit 0eddddb

Browse files
authored
Use strategy matrix to test with different db versions (#16)
1 parent fa4203c commit 0eddddb

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212

1313
build:
1414
runs-on: ubuntu-20.04
15+
strategy:
16+
matrix:
17+
mysql: [ 5.7.32, 8.0.22 ]
18+
tarantool: [ 1.10.8, 2.6.1 ]
1519
steps:
1620
- name: Print mysqldump version
1721
run: |
@@ -34,7 +38,11 @@ jobs:
3438
run: make build
3539

3640
- name: Test
37-
run: |
38-
make env_up
39-
make run_tests
40-
make env_down
41+
env:
42+
MYSQL_VERSION: ${{ matrix.mysql }}
43+
TARANTOOL_VERSION: ${{ matrix.tarantool }}
44+
run: make run_tests
45+
46+
- name: Cleanup
47+
if: ${{ always() }}
48+
run: make env_down

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ run_tests: env_up
2929
.PHONY: env_up
3030
env_up:
3131
docker-compose up -d
32-
sleep 5
32+
./docker/wait.sh
3333
docker-compose ps
3434

3535
.PHONY: env_down

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It uses `mysqldump` to fetch the origin data at first, then syncs data increment
1919
Create or use exist user with replication grants:
2020

2121
```sql
22-
GRANT RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
22+
GRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
2323
FLUSH PRIVILEGES;
2424
```
2525

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ version: '3.4'
22

33
services:
44
mysql:
5-
image: mysql:${MYSQL_VERSION:-5.7.21}
5+
image: mysql:${MYSQL_VERSION:-8.0.22}
66
environment:
77
- MYSQL_DATABASE=city
88
- MYSQL_USER=repl
99
- MYSQL_PASSWORD=repl
1010
- MYSQL_ROOT_PASSWORD=root_pwd
11-
command: --bind-address=0.0.0.0 --ssl=0 --log-bin=mysql-bin --server-id=1 --enforce_gtid_consistency=ON --gtid_mode=ON
11+
command: --bind-address=0.0.0.0 --ssl=0 --default-authentication-plugin=mysql_native_password --log-bin=mysql-bin --server-id=1 --enforce_gtid_consistency=ON --gtid_mode=ON
1212
volumes:
1313
- ./docker/mysql/init.d:/docker-entrypoint-initdb.d
1414
ports:
@@ -18,6 +18,6 @@ services:
1818
build:
1919
context: ./docker/tarantool
2020
args:
21-
VERSION: ${TARANTOOL_VERSION:-2.6.0}
21+
VERSION: ${TARANTOOL_VERSION:-2.6.1}
2222
ports:
2323
- '13301:3301'

docker/mysql/init.d/init.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GRANT RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
1+
GRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
22

33
CREATE TABLE users
44
(

docker/wait.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
__workdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
6+
__rootdir=$(dirname "${__workdir}")
7+
8+
cd "${__rootdir}"
9+
10+
while ! docker-compose exec -T mysql mysql --user=root --password=root_pwd -e "status" &> /dev/stdout ; do
11+
echo "Waiting for MySQL connection..."
12+
sleep 1
13+
done

0 commit comments

Comments
 (0)