diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9de3d38..e6cb4b87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,8 @@ jobs: MYSQL_PASSWORD: joomla_ut MYSQL_ROOT_PASSWORD: joomla_ut MYSQL_DATABASE: joomla_ut + options: >- + --health-cmd="mysqladmin ping -h localhost -u joomla_ut -pjoomla_ut" tests-unit-mariadb: name: Run Unit tests on MariaDB @@ -126,6 +128,8 @@ jobs: MARIADB_PASSWORD: joomla_ut MARIADB_ROOT_PASSWORD: joomla_ut MARIADB_DATABASE: joomla_ut + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" tests-unit-postgres: name: Run Unit tests on PostgreSQL @@ -150,6 +154,8 @@ jobs: POSTGRES_USER: joomla_ut POSTGRES_PASSWORD: joomla_ut POSTGRES_DB: joomla_ut + options: >- + --health-cmd="pg_isready -d joomla_ut" tests-unit-sqlsrv: name: Run Unit tests on SQLsrv @@ -183,6 +189,8 @@ jobs: ACCEPT_EULA: Y MSSQL_SA_PASSWORD: Password12! MSSQL_PID: Developer + options: >- + --health-cmd="bash -c 'SQLCMD=$(command -v /opt/mssql-tools/bin/sqlcmd || command -v /opt/mssql-tools18/bin/sqlcmd); [ -z \"$SQLCMD\" ] && exit 1; $SQLCMD -S localhost -U sa -P Password12! -C -Q SELECT\ 1'" tests-unit-windows: name: Run Unit tests on MSSQL (Windows) diff --git a/Tests/Mysql/MysqlDriverTest.php b/Tests/Mysql/MysqlDriverTest.php index 40499c00..fab980f9 100644 --- a/Tests/Mysql/MysqlDriverTest.php +++ b/Tests/Mysql/MysqlDriverTest.php @@ -39,9 +39,6 @@ class MysqlDriverTest extends AbstractDatabaseDriverTestCase */ public static function setUpBeforeClass(): void { - // Give the container a chance to get ready - sleep(20); - parent::setUpBeforeClass(); if (!static::$connection) { diff --git a/Tests/Mysqli/MysqliDriverTest.php b/Tests/Mysqli/MysqliDriverTest.php index 7bcb5ba5..adaaa3ae 100644 --- a/Tests/Mysqli/MysqliDriverTest.php +++ b/Tests/Mysqli/MysqliDriverTest.php @@ -7,7 +7,6 @@ namespace Joomla\Database\Tests\Mysqli; use Joomla\Database\DatabaseDriver; -use Joomla\Database\DatabaseFactory; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\Mysqli\MysqliDriver; use Joomla\Database\Mysqli\MysqliExporter; @@ -40,13 +39,6 @@ class MysqliDriverTest extends AbstractDatabaseDriverTestCase */ public static function setUpBeforeClass(): void { - $host = getenv('JOOMLA_TEST_DB_HOST'); - $port = getenv('JOOMLA_TEST_DB_PORT') ?: 3306; - - /** @var MysqliDriver $mysqli */ - $mysqli = (new DatabaseFactory())->getDriver('mysqli'); - $mysqli->healthCheck($host, $port, 10, 10, 1, 10); - parent::setUpBeforeClass(); if (!static::$connection) { diff --git a/Tests/Pgsql/PgsqlDriverTest.php b/Tests/Pgsql/PgsqlDriverTest.php index feecdb62..895614dc 100644 --- a/Tests/Pgsql/PgsqlDriverTest.php +++ b/Tests/Pgsql/PgsqlDriverTest.php @@ -31,9 +31,6 @@ class PgsqlDriverTest extends AbstractDatabaseDriverTestCase */ public static function setUpBeforeClass(): void { - // Give the container a chance to get ready - sleep(20); - parent::setUpBeforeClass(); if (!static::$connection) { diff --git a/Tests/Sqlsrv/SqlsrvDriverTest.php b/Tests/Sqlsrv/SqlsrvDriverTest.php index e833b586..0bf6c99c 100644 --- a/Tests/Sqlsrv/SqlsrvDriverTest.php +++ b/Tests/Sqlsrv/SqlsrvDriverTest.php @@ -29,9 +29,6 @@ class SqlsrvDriverTest extends AbstractDatabaseDriverTestCase */ public static function setUpBeforeClass(): void { - // Give the container a chance to get ready - sleep(20); - parent::setUpBeforeClass(); if (!static::$connection) {