diff options
Diffstat (limited to 'travis')
-rwxr-xr-x | travis/phing-sniff.sh | 17 | ||||
-rw-r--r-- | travis/phpunit-mariadb-travis.xml | 6 | ||||
-rw-r--r-- | travis/phpunit-mysql-travis.xml | 12 | ||||
-rw-r--r-- | travis/phpunit-mysqli-travis.xml | 45 | ||||
-rw-r--r-- | travis/phpunit-postgres-travis.xml | 11 | ||||
-rw-r--r-- | travis/phpunit-sqlite3-travis.xml | 42 | ||||
-rwxr-xr-x | travis/setup-database.sh | 26 | ||||
-rwxr-xr-x | travis/setup-php-extensions.sh | 57 | ||||
-rwxr-xr-x | travis/setup-phpbb.sh | 29 |
9 files changed, 229 insertions, 16 deletions
diff --git a/travis/phing-sniff.sh b/travis/phing-sniff.sh new file mode 100755 index 0000000000..04118af69a --- /dev/null +++ b/travis/phing-sniff.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# @copyright (c) 2014 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e +set -x + +DB=$1 +TRAVIS_PHP_VERSION=$2 + +if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] +then + cd build + ../phpBB/vendor/bin/phing sniff + cd .. +fi diff --git a/travis/phpunit-mariadb-travis.xml b/travis/phpunit-mariadb-travis.xml index 1eaee5b7d8..aa245a8224 100644 --- a/travis/phpunit-mariadb-travis.xml +++ b/travis/phpunit-mariadb-travis.xml @@ -13,9 +13,9 @@ bootstrap="../tests/bootstrap.php"> <testsuites> <testsuite name="phpBB Test Suite"> - <directory suffix="_test.php">../tests/</directory> - <exclude>tests/functional</exclude> - <exclude>tests/lint_test.php</exclude> + <directory suffix="_test.php">../tests</directory> + <exclude>../tests/functional</exclude> + <exclude>../tests/lint_test.php</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index e99f8d6cee..21122ccaeb 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -13,12 +13,9 @@ bootstrap="../tests/bootstrap.php"> <testsuites> <testsuite name="phpBB Test Suite"> - <directory suffix="_test.php">../tests/</directory> - <exclude>tests/functional</exclude> - <exclude>tests/lint_test.php</exclude> - </testsuite> - <testsuite name="phpBB Lint Test"> - <file>tests/lint_test.php</file> + <directory suffix="_test.php">../tests</directory> + <exclude>../tests/functional</exclude> + <exclude>../tests/lint_test.php</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> @@ -32,12 +29,13 @@ </groups> <php> - <server name="PHPBB_TEST_DBMS" value="mysqli" /> + <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysql" /> <server name="PHPBB_TEST_DBHOST" value="0.0.0.0" /> <server name="PHPBB_TEST_DBPORT" value="3306" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBUSER" value="root" /> <server name="PHPBB_TEST_DBPASSWD" value="" /> + <server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> </php> diff --git a/travis/phpunit-mysqli-travis.xml b/travis/phpunit-mysqli-travis.xml new file mode 100644 index 0000000000..60c279d774 --- /dev/null +++ b/travis/phpunit-mysqli-travis.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit backupGlobals="true" + backupStaticAttributes="true" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="true" + strict="true" + verbose="true" + bootstrap="../tests/bootstrap.php"> + <testsuites> + <testsuite name="phpBB Test Suite"> + <directory suffix="_test.php">../tests</directory> + <exclude>../tests/functional</exclude> + <exclude>../tests/lint_test.php</exclude> + </testsuite> + <testsuite name="phpBB Lint Test"> + <file>../tests/lint_test.php</file> + </testsuite> + <testsuite name="phpBB Functional Tests"> + <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> + </testsuite> + </testsuites> + + <groups> + <exclude> + <group>slow</group> + </exclude> + </groups> + + <php> + <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli" /> + <server name="PHPBB_TEST_DBHOST" value="0.0.0.0" /> + <server name="PHPBB_TEST_DBPORT" value="3306" /> + <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> + <server name="PHPBB_TEST_DBUSER" value="root" /> + <server name="PHPBB_TEST_DBPASSWD" value="" /> + <server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> + <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> + <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> + </php> +</phpunit> diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index aa829f4d30..956278e90c 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -13,9 +13,9 @@ bootstrap="../tests/bootstrap.php"> <testsuites> <testsuite name="phpBB Test Suite"> - <directory suffix="_test.php">../tests/</directory> - <exclude>tests/functional</exclude> - <exclude>tests/lint_test.php</exclude> + <directory suffix="_test.php">../tests</directory> + <exclude>../tests/functional</exclude> + <exclude>../tests/lint_test.php</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> @@ -29,14 +29,13 @@ </groups> <php> - <!-- "Real" test database --> - <!-- uncomment, otherwise sqlite memory runs --> - <server name="PHPBB_TEST_DBMS" value="postgres"/> + <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/> <server name="PHPBB_TEST_DBHOST" value="localhost" /> <server name="PHPBB_TEST_DBPORT" value="5432" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBUSER" value="postgres" /> <server name="PHPBB_TEST_DBPASSWD" value="" /> + <server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> </php> diff --git a/travis/phpunit-sqlite3-travis.xml b/travis/phpunit-sqlite3-travis.xml new file mode 100644 index 0000000000..72b8b8c8ca --- /dev/null +++ b/travis/phpunit-sqlite3-travis.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit backupGlobals="true" + backupStaticAttributes="true" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="true" + strict="true" + verbose="true" + bootstrap="../tests/bootstrap.php"> + <testsuites> + <testsuite name="phpBB Test Suite"> + <directory suffix="_test.php">../tests</directory> + <exclude>../tests/functional</exclude> + <exclude>../tests/lint_test.php</exclude> + </testsuite> + <testsuite name="phpBB Functional Tests"> + <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> + </testsuite> + </testsuites> + + <groups> + <exclude> + <group>slow</group> + </exclude> + </groups> + + <php> + <!--server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\sqlite3" /--> + <!--server name="PHPBB_TEST_DBHOST" value="../phpbb_unit_tests.sqlite3" /--> + <!--server name="PHPBB_TEST_DBPORT" value="" /--> + <!--server name="PHPBB_TEST_DBNAME" value="" /--> + <!--server name="PHPBB_TEST_DBUSER" value="" /--> + <!--server name="PHPBB_TEST_DBPASSWD" value="" /--> + <server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> + <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> + <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> + </php> +</phpunit> diff --git a/travis/setup-database.sh b/travis/setup-database.sh new file mode 100755 index 0000000000..8c19086191 --- /dev/null +++ b/travis/setup-database.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# @copyright (c) 2014 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e +set -x + +DB=$1 +TRAVIS_PHP_VERSION=$2 + +if [ "$DB" == "postgres" ] +then + psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres + psql -c 'create database phpbb_tests;' -U postgres +fi + +if [ "$TRAVIS_PHP_VERSION" == "5.3" -a "$DB" == "mysqli" ] +then + mysql -e 'SET GLOBAL storage_engine=MyISAM;' +fi + +if [ "$DB" == "mysql" -o "$DB" == "mysqli" -o "$DB" == "mariadb" ] +then + mysql -e 'create database IF NOT EXISTS phpbb_tests;' +fi diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh new file mode 100755 index 0000000000..826ee7409a --- /dev/null +++ b/travis/setup-php-extensions.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# +# @copyright (c) 2013 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e +set -x + +function find_php_ini +{ + echo $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||") +} + +# $1 - PHP extension name +# $2 - PHP ini file path +function register_php_extension +{ + echo "extension=$1.so" >> "$2" +} + +# $1 - PHP extension name +# $2 - PHP ini file path +function install_php_extension +{ + echo "Installing $1 PHP extension" + + # See http://www.php.net/manual/en/install.pecl.phpize.php + cd "$1" + phpize + ./configure + make + make install + cd .. + + register_php_extension "$1" "$2" +} + +php_ini_file=$(find_php_ini) + +# disable broken opcache on PHP 5.5.7 and 5.5.8 +if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.9', '<');"` == "1" ] +then + sed -i '/opcache.so/d' "$php_ini_file" +fi + +# apc +if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ] +then + echo 'Enabling APC PHP extension' + register_php_extension 'apc' "$php_ini_file" + echo 'apc.enable_cli=1' >> "$php_ini_file" +fi + +# redis +# Disabled redis for now as it causes travis to fail +# git clone git://github.com/nicolasff/phpredis.git redis +# install_php_extension 'redis' "$php_ini_file" diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh new file mode 100755 index 0000000000..f079a0a6b7 --- /dev/null +++ b/travis/setup-phpbb.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# @copyright (c) 2014 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e +set -x + +DB=$1 +TRAVIS_PHP_VERSION=$2 + +if [ "$DB" == "mariadb" ] +then + travis/setup-mariadb.sh +fi + +if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] +then + travis/setup-php-extensions.sh +fi + +if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` == "1" ] +then + travis/setup-webserver.sh +fi + +cd phpBB +php ../composer.phar install --dev --no-interaction --prefer-source +cd .. |