aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2013-01-24 01:16:56 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2013-01-24 01:16:56 -0500
commit01607be42a1c8fe2964c0c19a23473ccb5162801 (patch)
treecf85d449f5db9695a5bf57e30d9fa454ac767535 /travis
parentec97e60e17ad18d96ed73fc563b766a365005e58 (diff)
parent229d1092f8c18075ad03c6d67dd78707cbf1b421 (diff)
downloadforums-01607be42a1c8fe2964c0c19a23473ccb5162801.tar
forums-01607be42a1c8fe2964c0c19a23473ccb5162801.tar.gz
forums-01607be42a1c8fe2964c0c19a23473ccb5162801.tar.bz2
forums-01607be42a1c8fe2964c0c19a23473ccb5162801.tar.xz
forums-01607be42a1c8fe2964c0c19a23473ccb5162801.zip
Merge PR #1201 branch 'develop-olympus' into develop
* develop-olympus: [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. Conflicts: .travis.yml
Diffstat (limited to 'travis')
-rw-r--r--travis/phpunit-mysql-travis.xml3
-rw-r--r--travis/phpunit-postgres-travis.xml3
-rwxr-xr-xtravis/setup-webserver.sh54
3 files changed, 58 insertions, 2 deletions
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
index f5f1aa2417..2d6af0e2ac 100644
--- a/travis/phpunit-mysql-travis.xml
+++ b/travis/phpunit-mysql-travis.xml
@@ -17,7 +17,7 @@
<exclude>tests/functional</exclude>
</testsuite>
<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>
</testsuites>
@@ -36,5 +36,6 @@
<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 a202ec4a36..a9062efafb 100644
--- a/travis/phpunit-postgres-travis.xml
+++ b/travis/phpunit-postgres-travis.xml
@@ -17,7 +17,7 @@
<exclude>tests/functional</exclude>
</testsuite>
<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>
</testsuites>
@@ -38,5 +38,6 @@
<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-webserver.sh b/travis/setup-webserver.sh
new file mode 100755
index 0000000000..beb04b0fef
--- /dev/null
+++ b/travis/setup-webserver.sh
@@ -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