Unverified Commit c37710b2 authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #3092 from Majkl578/tests-better-coverage

CI: Aggregate coverage from multiple jobs
parents 6ee7d7d2 e0ee64e6
...@@ -4,13 +4,15 @@ platform: ...@@ -4,13 +4,15 @@ platform:
#matrix: #matrix:
# fast_finish: true # kills the build at the first failure # fast_finish: true # kills the build at the first failure
clone_folder: C:\projects\dbal clone_folder: C:\projects\dbal
clone_depth: 1 clone_depth: 2
cache: cache:
- C:\ProgramData\chocolatey\bin -> .appveyor.yml - C:\ProgramData\chocolatey\bin -> .appveyor.yml
- C:\ProgramData\chocolatey\lib -> .appveyor.yml - C:\ProgramData\chocolatey\lib -> .appveyor.yml
- C:\tools\php -> .appveyor.yml - C:\tools\php -> .appveyor.yml
- composer.phar - composer.phar
- ocular.phar
- cacert.pem
- '%LOCALAPPDATA%\Composer\files' - '%LOCALAPPDATA%\Composer\files'
#- vendor #- vendor
...@@ -20,19 +22,23 @@ environment: ...@@ -20,19 +22,23 @@ environment:
- db: mssql - db: mssql
driver: sqlsrv driver: sqlsrv
db_version: sql2008r2sp2 db_version: sql2008r2sp2
coverage: yes
php: 7.2 php: 7.2
- db: mssql - db: mssql
driver: sqlsrv driver: sqlsrv
db_version: sql2012sp1 db_version: sql2012sp1
php: 7.2 php: 7.2
coverage: yes
- db: mssql - db: mssql
driver: sqlsrv driver: sqlsrv
db_version: sql2017 db_version: sql2017
coverage: no
php: 7.2 php: 7.2
- db: mssql - db: mssql
driver: pdo_sqlsrv driver: pdo_sqlsrv
db_version: sql2017 db_version: sql2017
php: 7.2 php: 7.2
coverage: yes
init: init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH% - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
...@@ -59,6 +65,7 @@ install: ...@@ -59,6 +65,7 @@ install:
Add-Content php.ini "`n extension=php_fileinfo.dll" Add-Content php.ini "`n extension=php_fileinfo.dll"
Add-Content php.ini "`n extension=php_pdo_sqlite.dll" Add-Content php.ini "`n extension=php_pdo_sqlite.dll"
Add-Content php.ini "`n extension=php_sqlite3.dll" Add-Content php.ini "`n extension=php_sqlite3.dll"
Add-Content php.ini "`n extension=php_curl.dll"
# Get and install the MSSQL DLL's # Get and install the MSSQL DLL's
$DLLVersion = "5.2.0rc1" $DLLVersion = "5.2.0rc1"
...@@ -71,10 +78,15 @@ install: ...@@ -71,10 +78,15 @@ install:
$destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip" $destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip"
Invoke-WebRequest $source -OutFile $destination Invoke-WebRequest $source -OutFile $destination
7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip > $null 7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip > $null
$DLLVersion = "2.6.0"
$source = "https://xdebug.org/files/php_xdebug-$($DLLVersion)-$($env:php)-vc15-nts-x86_64.dll"
$destination = "c:\tools\php\ext\php_xdebug.dll"
Invoke-WebRequest $source -OutFile $destination
Remove-Item c:\tools\php\* -include .zip Remove-Item c:\tools\php\* -include .zip
cd c:\tools\php cd c:\tools\php
Add-Content php.ini "`nextension=php_sqlsrv.dll" Add-Content php.ini "`nextension=php_sqlsrv.dll"
Add-Content php.ini "`nextension=php_pdo_sqlsrv.dll" Add-Content php.ini "`nextension=php_pdo_sqlsrv.dll"
Add-Content php.ini "`nzend_extension=php_xdebug.dll"
Add-Content php.ini "`n" Add-Content php.ini "`n"
cd c:\projects\dbal cd c:\projects\dbal
...@@ -82,6 +94,14 @@ install: ...@@ -82,6 +94,14 @@ install:
if (!(Test-Path c:\projects\dbal\composer.phar)) { if (!(Test-Path c:\projects\dbal\composer.phar)) {
appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
} }
if (!(Test-Path c:\projects\dbal\ocular.phar)) {
appveyor-retry appveyor DownloadFile https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar
}
if (!(Test-Path c:\projects\dbal\cacert.pem)) {
appveyor-retry appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem
}
} }
# install composer dependencies # install composer dependencies
- rm composer.lock - rm composer.lock
...@@ -100,8 +120,14 @@ test_script: ...@@ -100,8 +120,14 @@ test_script:
- cd C:\projects\dbal - cd C:\projects\dbal
- ps: >- - ps: >-
if ($env:db_version) { if ($env:db_version) {
vendor\bin\phpunit -c tests\appveyor\%db%.%db_version%.%driver%.appveyor.xml $env:phpunit_config = "tests\appveyor\$($env:db).$($env:db_version).$($env:driver).appveyor.xml"
} else {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:driver).appveyor.xml"
} }
else { - ps: >-
vendor\bin\phpunit -c tests\appveyor\%db%.%driver%.appveyor.xml if ($env:coverage -eq "yes") {
vendor\bin\phpunit -c $($env:phpunit_config) --coverage-clover clover.xml
php.exe -d curl.cainfo=c:\projects\dbal\cacert.pem ocular.phar code-coverage:upload --format=php-clover clover.xml
} else {
vendor\bin\phpunit -c $($env:phpunit_config)
} }
...@@ -21,6 +21,7 @@ before_commands: ...@@ -21,6 +21,7 @@ before_commands:
tools: tools:
external_code_coverage: external_code_coverage:
timeout: 3600 timeout: 3600
runs: 20 # 17x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes)
filter: filter:
excluded_paths: excluded_paths:
......
...@@ -18,26 +18,67 @@ env: ...@@ -18,26 +18,67 @@ env:
- DB=mysqli - DB=mysqli
before_install: before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" - |
if [ "x$COVERAGE" != "xyes" ]; then
mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || true
fi
before_script: before_script:
- if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi; - if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi;
- |
if [ "x$COVERAGE" == "xyes" ] && [[ ! $(php -m | grep -si xdebug) ]]; then
echo "xdebug is required for coverage"
exit 1
fi
install: install:
- rm composer.lock - rm composer.lock
- travis_retry composer -n update --prefer-dist - travis_retry composer -n update --prefer-dist
script: ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml script:
- |
if [ "x$COVERAGE" == "xyes" ]; then
./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml --coverage-clover clover.xml
else
./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml
fi
after_script:
- |
if [ "x$COVERAGE" == "xyes" ]; then
wget https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover clover.xml
fi
jobs: jobs:
allow_failures: allow_failures:
- php: nightly - php: nightly
- stage: Coding standard - stage: Coding standard
exclude:
- php: 7.1
env: DB=sqlite
- php: 7.1
env: DB=mysql
- php: 7.1
env: DB=mysqli
include: include:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=mysql MYSQL_VERSION=5.7 env: DB=sqlite COVERAGE=yes
- stage: Test
php: 7.1
env: DB=mysql COVERAGE=yes
- stage: Test
php: 7.1
env: DB=mysqli COVERAGE=yes
- stage: Test
php: 7.1
env: DB=mysql MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required sudo: required
before_script: before_script:
- bash ./tests/travis/install-mysql-5.7.sh - bash ./tests/travis/install-mysql-5.7.sh
...@@ -56,7 +97,7 @@ jobs: ...@@ -56,7 +97,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=mysqli MYSQL_VERSION=5.7 env: DB=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required sudo: required
before_script: before_script:
- bash ./tests/travis/install-mysql-5.7.sh - bash ./tests/travis/install-mysql-5.7.sh
...@@ -75,7 +116,7 @@ jobs: ...@@ -75,7 +116,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=mariadb MARIADB_VERSION=10.0 env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes
addons: addons:
mariadb: 10.0 mariadb: 10.0
- stage: Test - stage: Test
...@@ -91,7 +132,7 @@ jobs: ...@@ -91,7 +132,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=mariadb MARIADB_VERSION=10.1 env: DB=mariadb MARIADB_VERSION=10.1 COVERAGE=yes
addons: addons:
mariadb: 10.1 mariadb: 10.1
- stage: Test - stage: Test
...@@ -107,7 +148,7 @@ jobs: ...@@ -107,7 +148,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=mariadb MARIADB_VERSION=10.2 env: DB=mariadb MARIADB_VERSION=10.2 COVERAGE=yes
addons: addons:
mariadb: 10.2 mariadb: 10.2
- stage: Test - stage: Test
...@@ -123,7 +164,7 @@ jobs: ...@@ -123,7 +164,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=mariadb.mysqli MARIADB_VERSION=10.2 env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes
addons: addons:
mariadb: 10.2 mariadb: 10.2
- stage: Test - stage: Test
...@@ -139,7 +180,7 @@ jobs: ...@@ -139,7 +180,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.2 env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes
services: services:
- postgresql - postgresql
addons: addons:
...@@ -161,7 +202,7 @@ jobs: ...@@ -161,7 +202,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.3 env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
services: services:
- postgresql - postgresql
addons: addons:
...@@ -183,7 +224,7 @@ jobs: ...@@ -183,7 +224,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.4 env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes
services: services:
- postgresql - postgresql
addons: addons:
...@@ -205,7 +246,7 @@ jobs: ...@@ -205,7 +246,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.5 env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes
services: services:
- postgresql - postgresql
addons: addons:
...@@ -227,7 +268,7 @@ jobs: ...@@ -227,7 +268,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.6 env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes
services: services:
- postgresql - postgresql
addons: addons:
...@@ -249,7 +290,7 @@ jobs: ...@@ -249,7 +290,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=10.0 env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes
sudo: required sudo: required
services: services:
- postgresql - postgresql
...@@ -279,7 +320,7 @@ jobs: ...@@ -279,7 +320,7 @@ jobs:
- bash ./tests/travis/install-postgres-10.sh - bash ./tests/travis/install-postgres-10.sh
- stage: Test - stage: Test
env: DB=sqlsrv env: DB=sqlsrv COVERAGE=yes
sudo: required sudo: required
services: services:
- docker - docker
...@@ -298,7 +339,7 @@ jobs: ...@@ -298,7 +339,7 @@ jobs:
- stage: Test - stage: Test
php: 7.1 php: 7.1
env: DB=pdo_sqlsrv env: DB=pdo_sqlsrv COVERAGE=yes
sudo: required sudo: required
services: services:
- docker - docker
...@@ -329,18 +370,6 @@ jobs: ...@@ -329,18 +370,6 @@ jobs:
- composer config minimum-stability dev - composer config minimum-stability dev
- travis_retry composer update --prefer-dist - travis_retry composer update --prefer-dist
- stage: Coverage
php: 7.1
env: DB=sqlite
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
script:
- ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml --coverage-clover clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
- stage: Pull request coding standard - stage: Pull request coding standard
if: type = pull_request if: type = pull_request
php: 7.1 php: 7.1
......
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" /> <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners> </listeners>
<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>
<groups> <groups>
<exclude> <exclude>
<group>performance</group> <group>performance</group>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment