👷Improve Travis, add PHP7.2.

Improve Travis CI configuration a bit and add PHP7.2 to the test matrix.
Add PHPUnit Testdox output and optionally deploy test results on release tags.
Add a configuration file for infection (Mutation Testing Framework).
This commit is contained in:
Klaus Weidenbach 2017-11-24 23:38:41 +01:00
parent e1fdac3278
commit ee929752e3
5 changed files with 37 additions and 7 deletions

View File

@ -39,6 +39,7 @@ addons:
php: php:
- '7.0' - '7.0'
- '7.1' - '7.1'
- '7.2'
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet # HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
#- 'hhvm' #- 'hhvm'
@ -69,7 +70,7 @@ matrix:
mariadb: '10.1' mariadb: '10.1'
# PHP7.1, PostgreSQL 9.6 # PHP7.1, PostgreSQL 9.6
- php: '7.1' - php: '7.1'
env: DB=pgsql POSTGRESQL_VERSION=9.6 env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
# Use newer postgres than 9.2 default # Use newer postgres than 9.2 default
addons: addons:
postgresql: '9.6' postgresql: '9.6'
@ -125,15 +126,19 @@ before_script:
- if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi - if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
# omitting "script:" will default to phpunit # omitting "script:" will default to phpunit
script: ./vendor/bin/phpunit $PHPUCOV -c tests/phpunit-$DB.xml script:
- ./vendor/bin/phpunit $PHPUCOV -c tests/$PHPUNITFILE
after_success: after_success:
# Generate API documentation and deploy it to gh-pages - cat tests/results/testdox.txt
# Generate API documentation and prepare for deployment
- ./tests/travis/gen_apidocs.sh - ./tests/travis/gen_apidocs.sh
#after_failure: after_failure:
- cat tests/results/testdox.txt
# Deploying release and API documentation to GitHub # Deploying release and API documentation to GitHub
#before_deploy: before_deploy:
- if [[ "$CODECOV" == "1" ]]; then zip -9 -r -q tests/hubzilla-testresults.zip tests/results; fi
deploy: deploy:
- provider: pages - provider: pages
skip_cleanup: true skip_cleanup: true
@ -152,6 +157,15 @@ deploy:
repo: redmatrix/hubzilla repo: redmatrix/hubzilla
tags: true tags: true
condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")' condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
# add code coverage and test results to release
- provider: releases
skip_cleanup: true
api_key: $GH_TOKEN
file: 'tests/hubzilla-testresults.zip'
on:
repo: redmatrix/hubzilla
tags: true
condition: '(-n "$GH_TOKEN") && ("$CODECOV" == "1")'
#after_deploy: #after_deploy:
#after_script: #after_script:

15
tests/infection.json.dist Normal file
View File

@ -0,0 +1,15 @@
{
"timeout": 13,
"source": {
"directories": [
"include",
"Zotlabs"
]
},
"logs": {
"text": "tests/results/infection-log.txt"
},
"phpUnit": {
"configDir": "tests"
}
}

View File

@ -1 +0,0 @@
phpunit-mysql.xml

View File

@ -30,5 +30,6 @@
<log type="coverage-clover" target="./results/coverage-clover.xml"/> <log type="coverage-clover" target="./results/coverage-clover.xml"/>
<log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35" <log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35"
highLowerBound="70"/> highLowerBound="70"/>
<log type="testdox-text" target="./results/testdox.txt"/>
</logging> </logging>
</phpunit> </phpunit>

View File

@ -14,7 +14,7 @@
<directory suffix="Test.php" prefix="API">./unit/</directory> <directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite> </testsuite>
<testsuite name="Ex-/Import Test Suite"> <testsuite name="Ex-/Import Test Suite">
<directory suffix="Test.php">./unit/eximport/</directory> <!--<directory suffix="Test.php">./unit/eximport/</directory>-->
</testsuite> </testsuite>
<groups> <groups>
<exclude> <exclude>
@ -33,5 +33,6 @@
<log type="coverage-clover" target="./results/coverage-clover.xml"/> <log type="coverage-clover" target="./results/coverage-clover.xml"/>
<log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35" <log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35"
highLowerBound="70"/> highLowerBound="70"/>
<log type="testdox-text" target="./results/testdox.txt"/>
</logging> </logging>
</phpunit> </phpunit>