Integration tests: set host user for mysql docker containers

When run pytest locally, tests fail because of `Permission denied: 'logs'`
This commit is contained in:
Nikita Fomichev 2024-03-23 14:53:13 +01:00
parent b2ebaa1d6c
commit 39732174e9
4 changed files with 10 additions and 0 deletions

View File

@ -22,3 +22,4 @@ services:
- type: ${MYSQL_LOGS_FS:-tmpfs}
source: ${MYSQL_LOGS:-}
target: /mysql/
user: ${MYSQL_DOCKER_USER}

View File

@ -21,3 +21,4 @@ services:
- type: ${MYSQL8_LOGS_FS:-tmpfs}
source: ${MYSQL8_LOGS:-}
target: /mysql/
user: ${MYSQL8_DOCKER_USER}

View File

@ -22,6 +22,7 @@ services:
- type: ${MYSQL_CLUSTER_LOGS_FS:-tmpfs}
source: ${MYSQL_CLUSTER_LOGS:-}
target: /mysql/
user: ${MYSQL_CLUSTER_DOCKER_USER}
mysql3:
image: mysql:8.0
restart: always
@ -44,6 +45,7 @@ services:
- type: ${MYSQL_CLUSTER_LOGS_FS:-tmpfs}
source: ${MYSQL_CLUSTER_LOGS:-}
target: /mysql/
user: ${MYSQL_CLUSTER_DOCKER_USER}
mysql4:
image: mysql:8.0
restart: always
@ -66,3 +68,4 @@ services:
- type: ${MYSQL_CLUSTER_LOGS_FS:-tmpfs}
source: ${MYSQL_CLUSTER_LOGS:-}
target: /mysql/
user: ${MYSQL_CLUSTER_DOCKER_USER}

View File

@ -1047,6 +1047,8 @@ class ClickHouseCluster:
env_variables["MYSQL_ROOT_HOST"] = "%"
env_variables["MYSQL_LOGS"] = self.mysql57_logs_dir
env_variables["MYSQL_LOGS_FS"] = "bind"
env_variables["MYSQL_DOCKER_USER"] = str(os.getuid())
self.base_cmd.extend(
["--file", p.join(docker_compose_yml_dir, "docker_compose_mysql.yml")]
)
@ -1069,6 +1071,8 @@ class ClickHouseCluster:
env_variables["MYSQL8_ROOT_HOST"] = "%"
env_variables["MYSQL8_LOGS"] = self.mysql8_logs_dir
env_variables["MYSQL8_LOGS_FS"] = "bind"
env_variables["MYSQL8_DOCKER_USER"] = str(os.getuid())
self.base_cmd.extend(
["--file", p.join(docker_compose_yml_dir, "docker_compose_mysql_8_0.yml")]
)
@ -1090,6 +1094,7 @@ class ClickHouseCluster:
env_variables["MYSQL_CLUSTER_ROOT_HOST"] = "%"
env_variables["MYSQL_CLUSTER_LOGS"] = self.mysql_cluster_logs_dir
env_variables["MYSQL_CLUSTER_LOGS_FS"] = "bind"
env_variables["MYSQL_CLUSTER_DOCKER_USER"] = str(os.getuid())
self.base_cmd.extend(
[