diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-01-22 19:54:48 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-01-23 15:48:44 +0100 |
commit | dee1b38ebcf4249a0204773c255e8ac8e348cb23 (patch) | |
tree | f8eda335120dc27a95145c319f98ad0388f3710e | |
parent | 9a0992f6a0618d8423d15db7fd7780fdfd4c1670 (diff) | |
download | forums-dee1b38ebcf4249a0204773c255e8ac8e348cb23.tar forums-dee1b38ebcf4249a0204773c255e8ac8e348cb23.tar.gz forums-dee1b38ebcf4249a0204773c255e8ac8e348cb23.tar.bz2 forums-dee1b38ebcf4249a0204773c255e8ac8e348cb23.tar.xz forums-dee1b38ebcf4249a0204773c255e8ac8e348cb23.zip |
[ticket/11337] Run functional tests on travis using nginx and php-fpm.
PHPBB3-11337
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | travis/phpunit-mysql-travis.xml | 1 | ||||
-rw-r--r-- | travis/phpunit-postgres-travis.xml | 1 | ||||
-rwxr-xr-x | travis/setup-webserver.sh | 53 |
4 files changed, 56 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index ba8c1b4a91..09c5059749 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ before_script: - cd phpBB - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ../composer.phar install --dev; fi" - cd .. + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then travis/setup-webserver.sh; fi" script: - phpunit --configuration travis/phpunit-$DB-travis.xml diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index 5366494c8b..df97f1c0f0 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -35,5 +35,6 @@ <server name="PHPBB_TEST_DBUSER" value="root" /> <server name="PHPBB_TEST_DBPASSWD" value="" /> <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 0383edd9d6..49c001b717 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -37,5 +37,6 @@ <server name="PHPBB_TEST_DBUSER" value="postgres" /> <server name="PHPBB_TEST_DBPASSWD" value="" /> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> + <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> </php> </phpunit> diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh new file mode 100755 index 0000000000..c475f0f7ff --- /dev/null +++ b/travis/setup-webserver.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# @copyright (c) 2013 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# + +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 +" | sudo tee $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 + +# Start daemons +sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf" +sudo service nginx start |