Skip to content

Commit

Permalink
fix: support for latest mariadb versions
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Nov 13, 2024
1 parent ecc94b8 commit 4f08b70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ def prepare_environment(
subprocess.run(cmd + ["chown", "dirac", "/home/dirac"], check=True)

typer.secho("Creating MySQL user", fg=c.GREEN)
cmd = ["docker", "exec", "mysql", "mysql", f"--password={DB_ROOTPWD}", "-e"]
mysql_command = "mariadb" if "mariadb" in docker_compose_env["MYSQL_VER"].lower() else "mysql"
cmd = ["docker", "exec", "mysql", f"{mysql_command}", f"--password={DB_ROOTPWD}", "-e"]
# It sometimes takes a while for MySQL to be ready so wait for a while if needed
for _ in range(10):
ret = subprocess.run(
Expand Down Expand Up @@ -777,6 +778,10 @@ def _make_env(flags):
env["HOST_OS"] = flags.pop("HOST_OS", DEFAULT_HOST_OS)
env["CI_REGISTRY_IMAGE"] = flags.pop("CI_REGISTRY_IMAGE", "diracgrid")
env["MYSQL_VER"] = flags.pop("MYSQL_VER", DEFAULT_MYSQL_VER)
if "mariadb" in env["MYSQL_VER"].lower():
env["MYSQL_ADMIN_COMMAND"] = "mariadb-admin"
else:
env["MYSQL_ADMIN_COMMAND"] = "mysqladmin"
env["ES_VER"] = flags.pop("ES_VER", DEFAULT_ES_VER)
env["IAM_VER"] = flags.pop("IAM_VER", DEFAULT_IAM_VER)
if "CVMFS_DIR" not in env or not Path(env["CVMFS_DIR"]).is_dir():
Expand Down
2 changes: 1 addition & 1 deletion tests/CI/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
ports:
- 3306:3306
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
test: ["CMD", "${MYSQL_ADMIN_COMMAND}", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
start_period: 60s
Expand Down

0 comments on commit 4f08b70

Please sign in to comment.