diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f8eecf0..b2a0a695 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 @@ -125,6 +127,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 @@ -148,7 +152,9 @@ jobs: env: POSTGRES_USER: root POSTGRES_PASSWORD: joomla_ut - POSTGRES_DB: test_joomla + POSTGRES_DB: joomla_ut + options: >- + --health-cmd="pg_isready -d joomla_ut" tests-unit-sqlsrv: name: Run Unit tests on SQLsrv @@ -181,6 +187,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 feae9357..1d537a62 100644 --- a/Tests/Mysql/MysqlDriverTest.php +++ b/Tests/Mysql/MysqlDriverTest.php @@ -36,9 +36,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 || static::$connection->getName() !== 'mysql') { diff --git a/Tests/Mysqli/MysqliDriverTest.php b/Tests/Mysqli/MysqliDriverTest.php index 59d5d33d..c34f7769 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; @@ -37,13 +36,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 || static::$connection->getName() !== 'mysqli') { diff --git a/Tests/Pgsql/PgsqlDriverTest.php b/Tests/Pgsql/PgsqlDriverTest.php index ee297a71..87ced7a9 100644 --- a/Tests/Pgsql/PgsqlDriverTest.php +++ b/Tests/Pgsql/PgsqlDriverTest.php @@ -26,9 +26,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 || static::$connection->getName() !== 'pgsql') { diff --git a/Tests/Sqlsrv/SqlsrvDriverTest.php b/Tests/Sqlsrv/SqlsrvDriverTest.php index 19bda8fc..5d94b30c 100644 --- a/Tests/Sqlsrv/SqlsrvDriverTest.php +++ b/Tests/Sqlsrv/SqlsrvDriverTest.php @@ -26,9 +26,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 || static::$connection->getName() !== 'sqlsrv') {