Skip to content
Extraits de code Groupes Projets
Valider e7da07ab rédigé par sgiehl's avatar sgiehl
Parcourir les fichiers

refs #4224, #4302 - added code coverage report using coveralls.io

parent 1a40bc2c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
service_name: travis-ci
src_dir: .
coverage_clover: build/logs/clover-*.xml
\ No newline at end of file
...@@ -34,6 +34,20 @@ matrix: ...@@ -34,6 +34,20 @@ matrix:
allow_failures: allow_failures:
- php: hhvm - php: hhvm
- php: 5.6 - php: 5.6
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Core
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Plugins
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Integration
include:
# Code Coverage
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Core
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Plugins
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Integration
exclude: exclude:
# Javascript tests need to run only on one PHP version # Javascript tests need to run only on one PHP version
- php: 5.4 - php: 5.4
...@@ -91,6 +105,10 @@ install: ...@@ -91,6 +105,10 @@ install:
- git checkout master -- ./tests/travis ./plugins/CoreConsole || true - git checkout master -- ./tests/travis ./plugins/CoreConsole || true
before_script: before_script:
- if [ -z "$TEST_SUITE" ];
then composer require satooshi/php-coveralls dev-master;
fi
- ./tests/travis/configure_git.sh - ./tests/travis/configure_git.sh
# print out mysql information # print out mysql information
...@@ -139,6 +157,10 @@ after_script: ...@@ -139,6 +157,10 @@ after_script:
# change directory back to root travis dir # change directory back to root travis dir
- cd $PIWIK_ROOT_DIR - cd $PIWIK_ROOT_DIR
- if [ -z "$TEST_SUITE" ];
then php vendor/bin/coveralls -v;
fi
# output contents of files w/ debugging info to screen # output contents of files w/ debugging info to screen
- cat /var/log/nginx/error.log - cat /var/log/nginx/error.log
- cat $PIWIK_ROOT_DIR/tmp/php-fpm.log - cat $PIWIK_ROOT_DIR/tmp/php-fpm.log
......
...@@ -101,3 +101,5 @@ The Piwik project uses an ever-expanding comprehensive set of thousands of unit ...@@ -101,3 +101,5 @@ The Piwik project uses an ever-expanding comprehensive set of thousands of unit
Build status (master branch) [![Build Status](https://travis-ci.org/piwik/piwik.png?branch=master)](https://travis-ci.org/piwik/piwik) - Screenshot tests Build [![Build Status](https://travis-ci.org/piwik/piwik-ui-tests.png?branch=master)](https://travis-ci.org/piwik/piwik-ui-tests) Build status (master branch) [![Build Status](https://travis-ci.org/piwik/piwik.png?branch=master)](https://travis-ci.org/piwik/piwik) - Screenshot tests Build [![Build Status](https://travis-ci.org/piwik/piwik-ui-tests.png?branch=master)](https://travis-ci.org/piwik/piwik-ui-tests)
Code Coverage: [![Coverage Status](https://coveralls.io/repos/piwik/piwik/badge.png?branch=master)](https://coveralls.io/r/piwik/piwik?branch=master)
...@@ -96,6 +96,10 @@ install: ...@@ -96,6 +96,10 @@ install:
{% endif %} {% endif %}
before_script: before_script:
- if [ -z "$TEST_SUITE" ];
then composer require satooshi/php-coveralls dev-master;
fi
- ./tests/travis/configure_git.sh - ./tests/travis/configure_git.sh
# print out mysql information # print out mysql information
...@@ -147,6 +151,10 @@ after_script: ...@@ -147,6 +151,10 @@ after_script:
# change directory back to root travis dir # change directory back to root travis dir
- cd $PIWIK_ROOT_DIR - cd $PIWIK_ROOT_DIR
- if [ -z "$TEST_SUITE" ];
then php vendor/bin/coveralls -v;
fi
# output contents of files w/ debugging info to screen # output contents of files w/ debugging info to screen
- cat /var/log/nginx/error.log - cat /var/log/nginx/error.log
- cat $PIWIK_ROOT_DIR/tmp/php-fpm.log - cat $PIWIK_ROOT_DIR/tmp/php-fpm.log
......
...@@ -47,4 +47,17 @@ ...@@ -47,4 +47,17 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../../core</directory>
<directory suffix=".php">../../plugins</directory>
<exclude>
<directory suffix=".php">../../core/Updates</directory>
<directory suffix=".php">../../plugins/*/Updates</directory>
<directory suffix=".php">../../plugins/*/libs</directory>
<directory suffix=".php">../../plugins/*/tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit> </phpunit>
...@@ -64,5 +64,17 @@ then ...@@ -64,5 +64,17 @@ then
fi fi
fi fi
else else
travis_wait phpunit --configuration phpunit.xml --coverage-text --colors if [ "$COVERAGE" = "Integration" ]
then
echo "Executing non Integration tests in test suite IntegrationTests..."
phpunit --configuration phpunit.xml --testsuite IntegrationTests --exclude-group Integration --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-integration.xml || true
elif [ "$COVERAGE" = "Core" ]
then
echo "Executing tests in test suite CoreTests..."
phpunit --configuration phpunit.xml --testsuite CoreTests --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-core.xml || true
elif [ "$COVERAGE" = "Plugins" ]
then
echo "Executing tests in test suite PluginTests..."
phpunit --configuration phpunit.xml --testsuite PluginTests --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-plugins.xml || true
fi;
fi fi
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter