Skip to content

Commit

Permalink
try and get mysql working
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlmoon committed Nov 20, 2023
1 parent 5116373 commit 0e2bd6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
env:
DB_DATABASE: mytestdb
DB_USER: test
DB_PASSWORD: test
DB_USER: root
DB_PASSWORD: root

steps:

Expand Down
14 changes: 9 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}
Expand All @@ -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");
Expand Down

0 comments on commit 0e2bd6e

Please sign in to comment.