Add coveralls.io for tracking test coverage
This commit is contained in:
parent
90ebdc2a26
commit
6f532a93c4
|
@ -0,0 +1,3 @@
|
|||
src_dir: .
|
||||
coverage_clover: ./tmp/clover.xml
|
||||
json_path: ./tmp/coveralls-upload.json
|
|
@ -14,6 +14,10 @@ matrix:
|
|||
env: WP_VERSION=latest WP_MULTISITE=0
|
||||
|
||||
before_script:
|
||||
- bash tests/install-wp-tests.sh woocommerce_test root '' localhost $WP_VERSION
|
||||
- bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION
|
||||
- bash tests/bin/travis.sh before
|
||||
|
||||
script: phpunit -c phpunit.xml.dist
|
||||
|
||||
after_script:
|
||||
- bash tests/bin/travis.sh after
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
# usage: travis.sh before|after
|
||||
|
||||
if [ $1 == 'before' ]; then
|
||||
|
||||
# composer install fails in PHP 5.2
|
||||
[ $TRAVIS_PHP_VERSION == '5.2' ] && exit;
|
||||
|
||||
# install php-coveralls to send coverage info
|
||||
composer init --require=satooshi/php-coveralls:0.7.x-dev -n
|
||||
composer install --no-interaction
|
||||
|
||||
elif [ $1 == 'after' ]; then
|
||||
|
||||
# no Xdebug and therefore no coverage in PHP 5.2
|
||||
[ $TRAVIS_PHP_VERSION == '5.2' ] && exit;
|
||||
|
||||
# send coverage data to coveralls
|
||||
php vendor/bin/coveralls --verbose --exclude-no-stmt
|
||||
fi
|
Loading…
Reference in New Issue