From 8aa17c285c95c66b719343b98fc9eb7677db56b6 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:12:42 +0200 Subject: [PATCH 1/7] Produce a clover.xml code coverage file. --- travis/run-phpunit.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis/run-phpunit.sh b/travis/run-phpunit.sh index 013cf3ae..713e98da 100755 --- a/travis/run-phpunit.sh +++ b/travis/run-phpunit.sh @@ -24,4 +24,5 @@ fi $PHPUNIT_EXTRA_ARGS \ --verbose \ --coverage-text \ + --coverage-clover code_coverage/clover.xml \ --coverage-html code_coverage/ From a29b46693cc184d7f7902e9727049be34b01e7ab Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:17:22 +0200 Subject: [PATCH 2/7] Upload clover.xml from Travis CI into Scrutinizer CI. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c6f56a9b..f12b4e0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,3 +26,5 @@ script: after_success: - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage.sh; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ocular.phar code-coverage:upload --format=php-clover code_coverage/clover.xml; fi" From 2c00f074e593e46b63bf60081ec47acbe8fdb213 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:21:36 +0200 Subject: [PATCH 3/7] Configure Scrutinizer CI to expect external code coverage data. --- .scrutinizer.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 00000000..d29cda28 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,5 @@ +imports: + - php + +tools: + external_code_coverage: true From b5fed807f3b7983d3bbe4dacec7eb7ee33aa2fcc Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:45:51 +0200 Subject: [PATCH 4/7] Add -html suffix to existing code-coverage shell script. --- .travis.yml | 2 +- .../{upload-code-coverage.sh => upload-code-coverage-html.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename travis/{upload-code-coverage.sh => upload-code-coverage-html.sh} (100%) diff --git a/.travis.yml b/.travis.yml index f12b4e0e..1f858845 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,6 @@ script: - travis/run-phpunit.sh after_success: - - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage.sh; fi" + - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage-html.sh; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ocular.phar code-coverage:upload --format=php-clover code_coverage/clover.xml; fi" diff --git a/travis/upload-code-coverage.sh b/travis/upload-code-coverage-html.sh similarity index 100% rename from travis/upload-code-coverage.sh rename to travis/upload-code-coverage-html.sh From 33e62401c386eb7efed9266b57333ad433790c83 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:49:15 +0200 Subject: [PATCH 5/7] Extract into upload-code-coverage-scrutinizer.sh --- .travis.yml | 3 +-- travis/upload-code-coverage-scrutinizer.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 travis/upload-code-coverage-scrutinizer.sh diff --git a/.travis.yml b/.travis.yml index 1f858845..0ca3896d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,5 +26,4 @@ script: after_success: - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage-html.sh; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ocular.phar code-coverage:upload --format=php-clover code_coverage/clover.xml; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then travis/upload-code-coverage-scrutinizer.sh; fi" diff --git a/travis/upload-code-coverage-scrutinizer.sh b/travis/upload-code-coverage-scrutinizer.sh new file mode 100755 index 00000000..efcff08c --- /dev/null +++ b/travis/upload-code-coverage-scrutinizer.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# This file is part of the phpseclib project. +# +# (c) Andreas Fischer +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +set -e + +wget https://scrutinizer-ci.com/ocular.phar +php ocular.phar code-coverage:upload --format=php-clover code_coverage/clover.xml From 825cd124aaa016eace39f178359b7b1c97cadac7 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:50:10 +0200 Subject: [PATCH 6/7] No Scrutinizer Code Coverage on HHVM either. Fatal error: Uncaught exception 'PharException' with message 'Corrupt phar, can't read 4 bytes starting at offset 1663508419' in : Stack trace: 0 (): Phar::bytesToInt() 1 (): Phar->parsePhar() 2 (): Phar->__construct() 3 /home/travis/build/phpseclib/phpseclib/ocular.phar(9): Phar::mapPhar() 4 {main} --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0ca3896d..661becfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ script: after_success: - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage-html.sh; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then travis/upload-code-coverage-scrutinizer.sh; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' -a '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/upload-code-coverage-scrutinizer.sh; fi" From 3cda3178625f73c8bf3ecf2f8cd555bee010fafe Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 1 Jun 2014 13:52:24 +0200 Subject: [PATCH 7/7] Specify the runs option for external code coverage. --- .scrutinizer.yml | 3 ++- .travis.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index d29cda28..4ad008a5 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -2,4 +2,5 @@ imports: - php tools: - external_code_coverage: true + external_code_coverage: + runs: 5 # No Code Coverage on PHP 5.2 and HHVM diff --git a/.travis.yml b/.travis.yml index 661becfb..9872b17c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: php +# When adding environments here, the number of runs specified in .scrutinizer.yml +# may have to be adjusted. php: - 5.2 - 5.3.3