Skip to content

Commit

Permalink
CI: Aggregate coverage from multiple jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 committed Apr 7, 2018
1 parent d4a96de commit f28f097
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 31 deletions.
26 changes: 23 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,23 @@ environment:
- db: mssql
driver: sqlsrv
db_version: sql2008r2sp2
coverage: yes
php: 7.2
- db: mssql
driver: sqlsrv
db_version: sql2012sp1
php: 7.2
coverage: yes
- db: mssql
driver: sqlsrv
db_version: sql2017
coverage: no
php: 7.2
- db: mssql
driver: pdo_sqlsrv
db_version: sql2017
php: 7.2
coverage: yes

init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
Expand All @@ -59,6 +63,7 @@ install:
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_sqlite3.dll"
Add-Content php.ini "`n extension=php_curl.dll"
# Get and install the MSSQL DLL's
$DLLVersion = "5.2.0rc1"
Expand All @@ -71,17 +76,26 @@ install:
$destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip"
Invoke-WebRequest $source -OutFile $destination
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
cd c:\tools\php
Add-Content php.ini "`nextension=php_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"
cd c:\projects\dbal
if (!(Test-Path c:\projects\dbal\composer.phar)) {
appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
}
if (!(Test-Path c:\projects\dbal\ocular.phar)) {
appveyor-retry appveyor DownloadFile https://scrutinizer-ci.com/ocular.phar
}
}
# install composer dependencies
- rm composer.lock
Expand All @@ -100,8 +114,14 @@ test_script:
- cd C:\projects\dbal
- ps: >-
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 {
vendor\bin\phpunit -c tests\appveyor\%db%.%driver%.appveyor.xml
- ps: >-
if ($env:coverage -eq "yes") {
vendor\bin\phpunit -c $($env:phpunit_config) --coverage-clover clover.xml
php.exe ocular.phar code-coverage:upload --repository $($env:APPVEYOR_REPO_NAME) --revision $($env:APPVEYOR_REPO_COMMIT) --format=php-clover clover.xml
} else {
vendor\bin\phpunit -c $($env:phpunit_config)
}
1 change: 1 addition & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ before_commands:
tools:
external_code_coverage:
timeout: 3600
runs: 20 # 21 # 17x Travis (jobs with COVERAGE=yes) + 3x AppVeyor + 1x ContinuousPHP

filter:
excluded_paths:
Expand Down
85 changes: 57 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,67 @@ env:
- DB=mysqli

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:
- 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:
- rm composer.lock
- 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://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover clover.xml
fi
jobs:
allow_failures:
- php: nightly
- stage: Coding standard

exclude:
- php: 7.1
env: DB=sqlite
- php: 7.1
env: DB=mysql
- php: 7.1
env: DB=mysqli

include:
- stage: Test
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
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
Expand All @@ -56,7 +97,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=mysqli MYSQL_VERSION=5.7
env: DB=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
Expand All @@ -75,7 +116,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.0
env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes
addons:
mariadb: 10.0
- stage: Test
Expand All @@ -91,7 +132,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.1
env: DB=mariadb MARIADB_VERSION=10.1 COVERAGE=yes
addons:
mariadb: 10.1
- stage: Test
Expand All @@ -107,7 +148,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.2
env: DB=mariadb MARIADB_VERSION=10.2 COVERAGE=yes
addons:
mariadb: 10.2
- stage: Test
Expand All @@ -123,7 +164,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=mariadb.mysqli MARIADB_VERSION=10.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes
addons:
mariadb: 10.2
- stage: Test
Expand All @@ -139,7 +180,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.2
env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes
services:
- postgresql
addons:
Expand All @@ -161,7 +202,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.3
env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
services:
- postgresql
addons:
Expand All @@ -183,7 +224,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.4
env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes
services:
- postgresql
addons:
Expand All @@ -205,7 +246,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.5
env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes
services:
- postgresql
addons:
Expand All @@ -227,7 +268,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.6
env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes
services:
- postgresql
addons:
Expand All @@ -249,7 +290,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=10.0
env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes
sudo: required
services:
- postgresql
Expand Down Expand Up @@ -279,7 +320,7 @@ jobs:
- bash ./tests/travis/install-postgres-10.sh

- stage: Test
env: DB=sqlsrv
env: DB=sqlsrv COVERAGE=yes
sudo: required
services:
- docker
Expand All @@ -298,7 +339,7 @@ jobs:

- stage: Test
php: 7.1
env: DB=pdo_sqlsrv
env: DB=pdo_sqlsrv COVERAGE=yes
sudo: required
services:
- docker
Expand Down Expand Up @@ -329,18 +370,6 @@ jobs:
- composer config minimum-stability dev
- 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
if: type = pull_request
php: 7.1
Expand Down
6 changes: 6 additions & 0 deletions tests/appveyor/mssql.sql2008r2sp2.sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/appveyor/mssql.sql2012sp1.sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/appveyor/mssql.sql2017.pdo_sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/appveyor/mssql.sql2017.sqlsrv.appveyor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/continuousphp/oci8.phpunit.continuousphp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/travis/mariadb.mysqli.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/travis/mariadb.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
6 changes: 6 additions & 0 deletions tests/travis/mysql.travis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<filter>
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
Expand Down
Loading

0 comments on commit f28f097

Please sign in to comment.