From ee929752e345f4d2fb02503fd589f9ad834a745c Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Fri, 24 Nov 2017 23:38:41 +0100 Subject: :construction_worker: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). --- .travis.yml | 24 +++++++++++++++++++----- tests/infection.json.dist | 15 +++++++++++++++ tests/phpunit-mariadb.xml | 1 - tests/phpunit-mysql.xml | 37 ------------------------------------- tests/phpunit-pgsql.xml | 1 + tests/phpunit.xml.dist | 38 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 43 deletions(-) create mode 100644 tests/infection.json.dist delete mode 120000 tests/phpunit-mariadb.xml delete mode 100644 tests/phpunit-mysql.xml create mode 100644 tests/phpunit.xml.dist diff --git a/.travis.yml b/.travis.yml index 41b480cf9..94c7b4226 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ addons: php: - '7.0' - '7.1' + - '7.2' # HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet #- 'hhvm' @@ -69,7 +70,7 @@ matrix: mariadb: '10.1' # PHP7.1, PostgreSQL 9.6 - 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 addons: postgresql: '9.6' @@ -125,15 +126,19 @@ before_script: - if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi # 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: - # 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 -#after_failure: +after_failure: + - cat tests/results/testdox.txt # 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: - provider: pages skip_cleanup: true @@ -152,6 +157,15 @@ deploy: repo: redmatrix/hubzilla tags: true 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_script: diff --git a/tests/infection.json.dist b/tests/infection.json.dist new file mode 100644 index 000000000..36b251982 --- /dev/null +++ b/tests/infection.json.dist @@ -0,0 +1,15 @@ +{ + "timeout": 13, + "source": { + "directories": [ + "include", + "Zotlabs" + ] + }, + "logs": { + "text": "tests/results/infection-log.txt" + }, + "phpUnit": { + "configDir": "tests" + } +} diff --git a/tests/phpunit-mariadb.xml b/tests/phpunit-mariadb.xml deleted file mode 120000 index 63656b78b..000000000 --- a/tests/phpunit-mariadb.xml +++ /dev/null @@ -1 +0,0 @@ -phpunit-mysql.xml \ No newline at end of file diff --git a/tests/phpunit-mysql.xml b/tests/phpunit-mysql.xml deleted file mode 100644 index 171211094..000000000 --- a/tests/phpunit-mysql.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - ./unit/ - - - ./unit/ - - - ./unit/eximport/ - - - - postgresql - - - - - - ../Zotlabs/ - ../include/ - - - - - - - - diff --git a/tests/phpunit-pgsql.xml b/tests/phpunit-pgsql.xml index ace14e196..ec4a6fc2d 100644 --- a/tests/phpunit-pgsql.xml +++ b/tests/phpunit-pgsql.xml @@ -30,5 +30,6 @@ + diff --git a/tests/phpunit.xml.dist b/tests/phpunit.xml.dist new file mode 100644 index 000000000..a22317b08 --- /dev/null +++ b/tests/phpunit.xml.dist @@ -0,0 +1,38 @@ + + + + ./unit/ + + + ./unit/ + + + + + + + postgresql + + + + + + ../Zotlabs/ + ../include/ + + + + + + + + + -- cgit v1.2.3