From 431d5d3bff7550eaabfad175f57c47e4d5bb9436 Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Mon, 14 Oct 2024 02:31:34 +0700 Subject: [PATCH] Fix MSSQL tests (#389) --- .github/workflows/db-mssql.yml | 7 ++++++- tests/Support/MssqlHelper.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/db-mssql.yml b/.github/workflows/db-mssql.yml index daad1284a..d506becd9 100644 --- a/.github/workflows/db-mssql.yml +++ b/.github/workflows/db-mssql.yml @@ -28,7 +28,7 @@ jobs: env: COMPOSER_ROOT_VERSION: dev-master - extensions: pdo, pdo_sqlsrv-5.10.1 + extensions: pdo, pdo_sqlsrv-5.12 key: cache-v1 runs-on: ubuntu-latest @@ -52,6 +52,11 @@ jobs: options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: + - name: Install ODBC driver. + run: | + sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list + sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 + - name: Checkout. uses: actions/checkout@v3 diff --git a/tests/Support/MssqlHelper.php b/tests/Support/MssqlHelper.php index a81683737..24bc42858 100644 --- a/tests/Support/MssqlHelper.php +++ b/tests/Support/MssqlHelper.php @@ -10,7 +10,7 @@ final class MssqlHelper extends ConnectionHelper { - private string $dsn = 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest'; + private string $dsn = 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest;Encrypt=no'; private string $username = 'SA'; private string $password = 'YourStrong!Passw0rd'; private string $charset = 'UTF8';