From 6c1bb7bb0710c4363f1e076f63dbb8ee27d70547 Mon Sep 17 00:00:00 2001 From: Cryp Toon Date: Tue, 6 Feb 2024 11:44:01 +0100 Subject: [PATCH] Try with different mariadb user 2 --- .github/workflows/unittests-mysql.yaml | 6 ++---- tests/test_tools.py | 7 +++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unittests-mysql.yaml b/.github/workflows/unittests-mysql.yaml index dad3629e..0148f79c 100644 --- a/.github/workflows/unittests-mysql.yaml +++ b/.github/workflows/unittests-mysql.yaml @@ -10,10 +10,8 @@ jobs: ports: - 3306 env: - MARIADB_ROOT_PASSWORD: password - MARIADB_DATABASE: test - MARIADB_USER: user - MARIADB_PASSWORD: password + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true + MARIADB_MYSQL_LOCALHOST_USER: 1 options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: diff --git a/tests/test_tools.py b/tests/test_tools.py index 667d3973..370d9f54 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -48,14 +48,17 @@ def database_init(dbname=DATABASE_NAME): try: con = mysql.connector.connect(user='user', host='localhost', password='password') except: - con = mysql.connector.connect(user='root', host='localhost', password='password') + try: + con = mysql.connector.connect(user='root', host='localhost', password='password') + except: + con = mysql.connector.connect(user='root', host='localhost') cur = con.cursor() cur.execute("DROP DATABASE IF EXISTS {}".format(dbname)) cur.execute("CREATE DATABASE {}".format(dbname)) con.commit() cur.close() con.close() - return 'mysql://root:password@localhost:3306/' + dbname + return 'mysql://root@localhost:3306/' + dbname else: dburi = os.path.join(str(BCL_DATABASE_DIR), '%s.sqlite' % dbname) if os.path.isfile(dburi):