Skip to content

Test SQL Server 17 on Travis #3050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,43 @@ jobs:
before_script:
- bash ./tests/travis/install-postgres-10.sh

- stage: Test
env: DB=sqlsrv
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: 7.2
env: DB=sqlsrv
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh

- stage: Test
php: 7.1
env: DB=pdo_sqlsrv
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: 7.2
env: DB=pdo_sqlsrv
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh

- stage: Test
php: 7.1
env: DB=sqlite DEPENDENCIES=low
Expand Down
6 changes: 6 additions & 0 deletions tests/travis/install-mssql-pdo_sqlsrv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -ex

echo "Installing extension"
pecl install pdo_sqlsrv-5.2.0RC1
6 changes: 6 additions & 0 deletions tests/travis/install-mssql-sqlsrv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -ex

echo "Installing extension"
pecl install sqlsrv-5.2.0RC1
38 changes: 38 additions & 0 deletions tests/travis/install-mssql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

set -ex

echo Installing drivers
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql.list
sudo apt-get update
ACCEPT_EULA=Y sudo apt-get install -qy msodbcsql17 mssql-tools unixodbc libssl1.0.0

echo Setting up Microsoft SQL Server

sudo docker pull microsoft/mssql-server-linux:2017-latest
sudo docker run \
-e 'ACCEPT_EULA=Y' \
-e 'SA_PASSWORD=Doctrine2018' \
-p 127.0.0.1:1433:1433 \
--name db \
-d \
microsoft/mssql-server-linux:2017-latest


retries=10
until (echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Doctrine2018 &> /dev/null)
do
if [[ "$retries" -le 0 ]]; then
echo SQL Server did not start
exit 1
fi

retries=$((retries - 1))

echo Waiting for SQL Server to start...

sleep 2s
done

echo SQL Server started
43 changes: 43 additions & 0 deletions tests/travis/pdo_sqlsrv.travis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />

<var name="db_type" value="pdo_sqlsrv"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_username" value="sa" />
<var name="db_password" value="Doctrine2018" />
<var name="db_name" value="doctrine" />
<var name="db_port" value="1433"/>

<var name="tmpdb_type" value="pdo_sqlsrv"/>
<var name="tmpdb_host" value="127.0.0.1" />
<var name="tmpdb_username" value="sa" />
<var name="tmpdb_password" value="Doctrine2018" />
<var name="tmpdb_port" value="1433"/>
</php>

<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
</testsuite>
</testsuites>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>
43 changes: 43 additions & 0 deletions tests/travis/sqlsrv.travis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />

<var name="db_type" value="sqlsrv"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_username" value="sa" />
<var name="db_password" value="Doctrine2018" />
<var name="db_name" value="doctrine" />
<var name="db_port" value="1433"/>

<var name="tmpdb_type" value="sqlsrv"/>
<var name="tmpdb_host" value="127.0.0.1" />
<var name="tmpdb_username" value="sa" />
<var name="tmpdb_password" value="Doctrine2018" />
<var name="tmpdb_port" value="1433"/>
</php>

<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
</testsuite>
</testsuites>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>