mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge PR #1201 branch 'bantu/ticket/11337' into develop-olympus
# By Andreas Fischer # Via Andreas Fischer * bantu/ticket/11337: [ticket/11337] Abort setup-webserver.sh script when an error occurs. [ticket/11337] Only run functional tests on 5.3.19 or higher. No FPM otherwise. [ticket/11337] Silence nginx config file writing. [ticket/11337] php-fpm.conf is no longer owned by root. [ticket/11337] Run functional tests on travis using nginx and php-fpm.
This commit is contained in:
commit
229d1092f8
4 changed files with 59 additions and 2 deletions
|
@ -24,6 +24,7 @@ before_script:
|
||||||
- cd phpBB
|
- cd phpBB
|
||||||
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ../composer.phar install --dev; fi"
|
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ../composer.phar install --dev; fi"
|
||||||
- cd ..
|
- cd ..
|
||||||
|
- sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- phpunit --configuration travis/phpunit-$DB-travis.xml
|
- phpunit --configuration travis/phpunit-$DB-travis.xml
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<exclude>tests/functional</exclude>
|
<exclude>tests/functional</exclude>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="phpBB Functional Tests">
|
<testsuite name="phpBB Functional Tests">
|
||||||
<directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">../tests/functional</directory>
|
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
|
@ -35,5 +35,6 @@
|
||||||
<server name="PHPBB_TEST_DBUSER" value="root" />
|
<server name="PHPBB_TEST_DBUSER" value="root" />
|
||||||
<server name="PHPBB_TEST_DBPASSWD" value="" />
|
<server name="PHPBB_TEST_DBPASSWD" value="" />
|
||||||
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
|
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
|
||||||
|
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
|
||||||
</php>
|
</php>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<exclude>tests/functional</exclude>
|
<exclude>tests/functional</exclude>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="phpBB Functional Tests">
|
<testsuite name="phpBB Functional Tests">
|
||||||
<directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">../tests/functional</directory>
|
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
|
@ -37,5 +37,6 @@
|
||||||
<server name="PHPBB_TEST_DBUSER" value="postgres" />
|
<server name="PHPBB_TEST_DBUSER" value="postgres" />
|
||||||
<server name="PHPBB_TEST_DBPASSWD" value="" />
|
<server name="PHPBB_TEST_DBPASSWD" value="" />
|
||||||
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
|
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
|
||||||
|
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
|
||||||
</php>
|
</php>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|
54
travis/setup-webserver.sh
Executable file
54
travis/setup-webserver.sh
Executable file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# @copyright (c) 2013 phpBB Group
|
||||||
|
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
#
|
||||||
|
set -e
|
||||||
|
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -qq nginx realpath
|
||||||
|
|
||||||
|
sudo service nginx stop
|
||||||
|
|
||||||
|
DIR=$(dirname "$0")
|
||||||
|
PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB")
|
||||||
|
|
||||||
|
NGINX_CONF="/etc/nginx/sites-enabled/default"
|
||||||
|
|
||||||
|
PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
|
||||||
|
PHP_FPM_CONF="$DIR/php-fpm.conf"
|
||||||
|
PHP_FPM_SOCK=$(realpath "$DIR")/php-fpm.sock
|
||||||
|
|
||||||
|
USER=$(whoami)
|
||||||
|
|
||||||
|
# php-fpm configuration
|
||||||
|
echo "
|
||||||
|
[global]
|
||||||
|
|
||||||
|
[travis]
|
||||||
|
user = $USER
|
||||||
|
group = $USER
|
||||||
|
listen = $PHP_FPM_SOCK
|
||||||
|
pm = static
|
||||||
|
pm.max_children = 2
|
||||||
|
|
||||||
|
php_admin_value[memory_limit] = 128M
|
||||||
|
" > $PHP_FPM_CONF
|
||||||
|
|
||||||
|
# nginx configuration
|
||||||
|
echo "
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
root $PHPBB_ROOT_PATH/;
|
||||||
|
index index.php index.html;
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass unix:$PHP_FPM_SOCK;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
" | sudo tee $NGINX_CONF > /dev/null
|
||||||
|
|
||||||
|
# Start daemons
|
||||||
|
sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf"
|
||||||
|
sudo service nginx start
|
Loading…
Add table
Reference in a new issue