From 0e2bd6ea13d18cd85afc0b582f9fbe0c8225bd8d Mon Sep 17 00:00:00 2001 From: Brian Moon Date: Mon, 20 Nov 2023 15:21:27 -0600 Subject: [PATCH] try and get mysql working --- .github/workflows/ci.yml | 4 ++-- tests/bootstrap.php | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 918fc5b..4f44ac9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,8 @@ jobs: env: DB_DATABASE: mytestdb - DB_USER: test - DB_PASSWORD: test + DB_USER: root + DB_PASSWORD: root steps: diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2ff4f7f..1a36a46 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -44,8 +44,10 @@ function _shutdown() { // Check if we are running inside a docker container already // If so, set the env vars correctly and don't run setup/teardown if (trim(`which docker`) === '') { - $mysql_host = 'db-mysql-sandbox'; + $mysql_host = 'localhost'; $mysql_port = 3306; + $mysql_user = 'root'; + $mysql_pass = 'root'; $pgsql_host = 'db-pgsql-sandbox'; $pgsql_port = 5432; } else { @@ -60,6 +62,8 @@ function _shutdown() { $mysql_host = '127.0.0.1'; $mysql_port = 43306; + $mysql_user = 'test'; + $mysql_pass = 'test'; $pgsql_host = '127.0.0.1'; $pgsql_port = 55432; } @@ -75,14 +79,14 @@ function _shutdown() { putenv('DEALNEWS_DB_MYPDOTESTDB_TYPE=pdo'); putenv("DEALNEWS_DB_MYPDOTESTDB_DSN=mysql:host={$mysql_host};port={$mysql_port};dbname=mytestdb"); -putenv('DEALNEWS_DB_MYPDOTESTDB_USER=test'); -putenv('DEALNEWS_DB_MYPDOTESTDB_PASS=test'); +putenv("DEALNEWS_DB_MYPDOTESTDB_USER={$mysql_user}"); +putenv("DEALNEWS_DB_MYPDOTESTDB_PASS={$mysql_pass}"); putenv('DEALNEWS_DB_MYTESTDB_TYPE=mysql'); putenv("DEALNEWS_DB_MYTESTDB_SERVER={$mysql_host}"); putenv("DEALNEWS_DB_MYTESTDB_PORT={$mysql_port}"); -putenv('DEALNEWS_DB_MYTESTDB_USER=test'); -putenv('DEALNEWS_DB_MYTESTDB_PASS=test'); +putenv("DEALNEWS_DB_MYTESTDB_USER={$mysql_user}"); +putenv("DEALNEWS_DB_MYTESTDB_PASS={$mysql_pass}"); putenv('DEALNEWS_DB_PGPDOTESTDB_TYPE=pdo'); putenv("DEALNEWS_DB_PGPDOTESTDB_DSN=pgsql:host={$pgsql_host};port={$pgsql_port};dbname=pgtestdb");