Report test coverage for PHP

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2020-03-31 14:32:42 +02:00
parent 78e4faac65
commit 6e34f162b7
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
3 changed files with 36 additions and 1 deletions

View File

@ -38,3 +38,10 @@ jobs:
- name: Run tests
working-directory: nextcloud/apps/calendar
run: composer run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./nextcloud/apps/calendar/tests/php/clover.unit.xml
flags: php
fail_ci_if_error: true

View File

@ -15,6 +15,6 @@
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;",
"phan": "phan --allow-polyfill-parser -k .phan/config.php",
"test": "phpunit --bootstrap tests/php/unit/bootstrap.php tests/php/unit/ --fail-on-warning"
"test": "phpunit --configuration tests/php/phpunit.unit.xml --fail-on-warning"
}
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="unit/bootstrap.php"
verbose="true"
timeoutForSmallTests="900"
timeoutForMediumTests="900"
timeoutForLargeTests="900"
>
<testsuite name='Calendar app tests'>
<directory suffix='test.php'>unit</directory>
<directory suffix='Test.php'>unit</directory>
</testsuite>
<!-- filters for code coverage -->
<filter>
<whitelist>
<directory suffix=".php">../../</directory>
<exclude>
<directory suffix=".php">../calendar/appinfo</directory>
<directory suffix=".php">../calendar/l10n</directory>
<directory suffix=".php">../calendar/templates</directory>
<directory suffix=".php">../calendar/tests</directory>
</exclude>
</whitelist>
</filter>
<logging>
<!-- and this is where your report will be written -->
<log type="coverage-clover" target="./clover.unit.xml"/>
</logging>
</phpunit>