-
Notifications
You must be signed in to change notification settings - Fork 679
/
docker-compose-test.yml
105 lines (93 loc) · 2.18 KB
/
docker-compose-test.yml
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
version: '3.4'
x-mysql: &mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
command: >
mysqld
--log-bin=mysql-bin.log
--server-id 1
--binlog-format=row
--gtid_mode=on
--enforce-gtid-consistency=on
x-mariadb: &mariadb
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
command: >
--server-id=1
--default-authentication-plugin=mysql_native_password
--log-bin=master-bin
--binlog-format=row
services:
percona-5.7-ctl:
<<: *mysql
image: percona:5.7
ports:
- "3307:3306"
networks:
- default
percona-5.7:
<<: *mysql
image: percona:5.7
ports:
- "3306:3306"
networks:
- default
percona-8.0:
<<: *mysql
image: percona:8.0
platform: linux/amd64
ports:
- "3309:3306"
networks:
- default
mariadb-10.6:
<<: *mariadb
image: mariadb:10.6
ports:
- "3308:3306"
volumes:
- type: bind
source: ./.mariadb
target: /opt/key_file
- type: bind
source: ./.mariadb/my.cnf
target: /etc/mysql/my.cnf
networks:
- default
pymysqlreplication:
build:
context: .
dockerfile: test.Dockerfile
args:
BASE_IMAGE: python:3.11-alpine
MYSQL_5_7: percona-5.7
MYSQL_5_7_CTL: percona-5.7-ctl
MYSQL_5_7_CTL_PORT: 3306
MYSQL_8_0: percona-8.0
MYSQL_8_0_PORT: 3306
MARIADB_10_6: mariadb-10.6
MARIADB_10_6_PORT: 3306
command:
- /bin/sh
- -ce
- |
echo "wait mysql server"
while :
do
if mysql -h percona-5.7 --user=root --execute "SELECT version();" 2>&1 >/dev/null && mysql -h percona-5.7-ctl --user=root --execute "SELECT version();" 2>&1 >/dev/null && mysql -h percona-8.0 --user=root --execute "SELECT version();" 2>&1 >/dev/null; then
break
fi
sleep 1
done
echo "run pytest"
pytest -k "not test_no_trailing_rotate_event and not test_end_log_pos"
working_dir: /pymysqlreplication
networks:
- default
depends_on:
- percona-5.7
- percona-5.7-ctl
- percona-8.0
networks:
default:
driver: bridge