Skip to content

Commit

Permalink
Try with different mariadb user 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Feb 6, 2024
1 parent d78faaf commit 6c1bb7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/unittests-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6c1bb7b

Please sign in to comment.