diff --git a/.travis.yml b/.travis.yml index ac54fcdf862..c863ee54ab8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,9 +56,10 @@ jobs: - bash ./tests/travis/install-mysql-5.7.sh - stage: Test php: 7.2 - env: DB=mysql MYSQL_VERSION=8.0 COVERAGE=yes - dist: xenial + env: DB=mysql.docker MYSQL_VERSION=8.0 COVERAGE=yes sudo: required + services: + - docker before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test @@ -72,9 +73,10 @@ jobs: - bash ./tests/travis/install-mysql-5.7.sh - stage: Test php: 7.2 - env: DB=mysqli MYSQL_VERSION=8.0 COVERAGE=yes - dist: xenial + env: DB=mysqli.docker MYSQL_VERSION=8.0 COVERAGE=yes sudo: required + services: + - docker before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test @@ -207,16 +209,18 @@ jobs: - travis_retry composer update --prefer-dist --prefer-lowest - stage: Test php: 7.3 - env: DB=mysql MYSQL_VERSION=8.0 - dist: xenial + env: DB=mysql.docker MYSQL_VERSION=8.0 sudo: required + services: + - docker before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test php: 7.3 - env: DB=mysqli MYSQL_VERSION=8.0 - dist: xenial + env: DB=mysqli.docker MYSQL_VERSION=8.0 sudo: required + services: + - docker before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test @@ -260,16 +264,18 @@ jobs: - bash ./tests/travis/install-mssql.sh - stage: Test php: nightly - env: DB=mysql MYSQL_VERSION=8.0 - dist: xenial + env: DB=mysql.docker MYSQL_VERSION=8.0 sudo: required + services: + - docker before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test php: nightly - env: DB=mysqli MYSQL_VERSION=8.0 - dist: xenial + env: DB=mysqli.docker MYSQL_VERSION=8.0 sudo: required + services: + - docker before_script: - bash ./tests/travis/install-mysql-8.0.sh - stage: Test diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/Mysqli/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/Mysqli/ConnectionTest.php index 8c274e1cbb2..bbd8d5ebd09 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Driver/Mysqli/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/Mysqli/ConnectionTest.php @@ -61,6 +61,7 @@ private function getConnection(array $driverOptions) [ 'host' => $GLOBALS['db_host'], 'dbname' => $GLOBALS['db_name'], + 'port' => $GLOBALS['db_port'], ], $GLOBALS['db_username'], $GLOBALS['db_password'], diff --git a/tests/travis/install-mysql-8.0.sh b/tests/travis/install-mysql-8.0.sh index 1a4092e3aae..d3622777f3e 100644 --- a/tests/travis/install-mysql-8.0.sh +++ b/tests/travis/install-mysql-8.0.sh @@ -2,15 +2,18 @@ set -ex -echo "Installing MySQL 8.0..." +echo "Starting MySQL 8.0..." -echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections -wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb -sudo dpkg --install mysql-apt-config_0.8.10-1_all.deb -sudo apt-get update -q -sudo apt-get install -q -y --force-yes -o Dpkg::Options::=--force-confnew mysql-server -echo -e "[mysqld]\ndefault_authentication_plugin=mysql_native_password" | sudo tee --append /etc/mysql/my.cnf -sudo /etc/init.d/mysql start -sudo mysql_upgrade +echo -e "[mysqld]\ndefault_authentication_plugin=mysql_native_password" > /tmp/mysql-auth.cnf -mysql --version +sudo docker pull mysql:8.0 +sudo docker run \ + -d \ + -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ + -e MYSQL_DATABASE=doctrine_tests \ + -v /tmp/mysql-auth.cnf:/etc/mysql/conf.d/auth.cnf:ro \ + -p 33306:3306 \ + --name mysql80 \ + mysql:8.0 + +sudo docker exec -i mysql80 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done' diff --git a/tests/travis/mysql.docker.travis.xml b/tests/travis/mysql.docker.travis.xml new file mode 100644 index 00000000000..21fae6f35e9 --- /dev/null +++ b/tests/travis/mysql.docker.travis.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + ../Doctrine/Tests/DBAL + + + + + + ../../lib/Doctrine + + + + + + + + + + performance + locking_functional + + + diff --git a/tests/travis/mysqli.docker.travis.xml b/tests/travis/mysqli.docker.travis.xml new file mode 100644 index 00000000000..935815e9cf4 --- /dev/null +++ b/tests/travis/mysqli.docker.travis.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + ../Doctrine/Tests/DBAL + + + + + + ../../lib/Doctrine + + + + + + + + + + performance + locking_functional + + +