This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, 6.0 has been updated
via d3b6321bbc7a061c750f14a618e180deb844f596 (commit)
from 743f0142ec53fd122587481cab1e1adad6ded7ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d3b6321bbc7a061c750f14a618e180deb844f596
commit d3b6321bbc7a061c750f14a618e180deb844f596
Author: Sylvain Beucler <[email protected]>
Date: Mon Sep 7 14:22:44 2015 +0200
testsuite: rename/move the various shell scripts for clarity
diff --git a/autoinstall/install-src.sh b/autoinstall/install-src.sh
index 696fb5a..9b5d2a1 100755
--- a/autoinstall/install-src.sh
+++ b/autoinstall/install-src.sh
@@ -62,6 +62,3 @@ fi
fi
make post-install
)
-
-# Dump clean DB
-if [ ! -e /root/dump ]; then $(dirname $0)/../tests/func/db_reload.sh
--backup; fi
diff --git a/tests/README b/tests/README
index ff39727..d2cdd2e 100644
--- a/tests/README
+++ b/tests/README
@@ -1,3 +1,5 @@
- code: static code checks
- unit: unit tests
- func: functional tests using Selenium
+
+- buildbot: run the testsuite with Jenkins and LXC containers
diff --git a/tests/buildbot/config/default b/tests/buildbot/config/default
index 5167f59..4cbd492 100644
--- a/tests/buildbot/config/default
+++ b/tests/buildbot/config/default
@@ -1,8 +1,4 @@
# -*- shell-script -*-
-# In this file you can find vars that are useable
-# both as an include in a Makefile or
-# be sourced in a shell
-# So it should only be stuffs like VAR=value
# Do we reuse VMs or destroy&recreate them?
KEEPVM=false
@@ -10,5 +6,5 @@ KEEPVM=false
# LXC post-install
# Debian security mirror
DEBMIRRORSEC=http://security.debian.org/
-# Redhat mirrors
+# Fedora EPEL mirror
#EPEL_REPO=http://download.fedoraproject.org/pub/epel
diff --git a/tests/buildbot/fusionforge-func_tests.sh
b/tests/buildbot/fusionforge-func_tests.sh
index 99443d4..27e6f5d 100755
--- a/tests/buildbot/fusionforge-func_tests.sh
+++ b/tests/buildbot/fusionforge-func_tests.sh
@@ -173,7 +173,7 @@ fi
retcode=0
echo "Run phpunit test on $HOST"
#ssh root@$HOST "TESTGLOB='func/50_PluginsScmBzr/*'
/usr/src/fusionforge/autoinstall/vnc-run-testsuite.sh
/usr/src/fusionforge/autoinstall/run-testsuite.sh $INSTALL_METHOD/$INSTALL_OS"
|| retcode=$?
-ssh root@$HOST "/usr/src/fusionforge/tests/func/vnc-run-testsuite.sh
/usr/src/fusionforge/tests/func/run-testsuite.sh $INSTALL_METHOD/$INSTALL_OS
$*" || retcode=$?
+ssh root@$HOST "/usr/src/fusionforge/tests/func_tests-xvnc.sh
$INSTALL_METHOD/$INSTALL_OS $*" || retcode=$?
copy_logs
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 6bece12..db16b1e 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -86,7 +86,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_SeleniumTestCase
*/
public function loadCachedFixture() {
$this->fixture_loaded = false;
- $base_cmd = dirname(__FILE__)."/db_reload.sh";
+ $base_cmd = dirname(__FILE__)."/fixtures.sh";
$ret = 0;
passthru("$base_cmd --exists {$this->fixture}", $ret);
ob_flush();
if ($ret != 0) {
@@ -111,7 +111,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_SeleniumTestCase
*/
public function loadAndCacheFixture() {
if (!$this->fixture_loaded) {
- $base_cmd = dirname(__FILE__)."/db_reload.sh";
+ $base_cmd = dirname(__FILE__)."/fixtures.sh";
$ret = 0;
passthru("$base_cmd base", $ret); ob_flush();
@@ -125,8 +125,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_SeleniumTestCase
public function changeConfig($text) {
- $forge_get_config = RUN_JOB_PATH."/forge_get_config";
- $config_path = rtrim(`$forge_get_config config_path`);
+ $config_path = rtrim(`forge_get_config config_path`);
$classname = get_class($this);
file_put_contents("$config_path/config.ini.d/zzz-buildbot-$classname.ini",
$text);
@@ -180,12 +179,12 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_SeleniumTestCase
public function cron($cmd)
{
- $this->runCommand(RUN_JOB_PATH."/forge_run_job $cmd");
+ $this->runCommand("forge_run_job $cmd");
}
public function cron_for_plugin($cmd, $plugin)
{
- $this->runCommand(RUN_JOB_PATH."/forge_run_plugin_job $plugin
$cmd");
+ $this->runCommand("forge_run_plugin_job $plugin $cmd");
}
/**
@@ -193,7 +192,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_SeleniumTestCase
*/
public function waitSystasks()
{
-
$this->runCommand(RUN_JOB_PATH.'/systasks_wait_until_empty.php');
+
$this->runCommand(dirname(__FILE__).'/../../src/bin/systasks_wait_until_empty.php');
}
public function init() {
diff --git a/tests/func/db_reload.sh b/tests/func/fixtures.sh
similarity index 99%
rename from tests/func/db_reload.sh
rename to tests/func/fixtures.sh
index 4bf9caf..0f7a249 100755
--- a/tests/func/db_reload.sh
+++ b/tests/func/fixtures.sh
@@ -1,9 +1,6 @@
#!/bin/bash
-
# Reinitialize the system to base or fixture'd state (database, SCM
# repos, plugins data...) to pass new tests
-# TODO: rename me
-
is_db_up () {
# 'service postgresql status' is not reliable enough
diff --git a/tests/func/phpunit-selenium.sh b/tests/func/phpunit-selenium.sh
deleted file mode 100755
index 9a898ba..0000000
--- a/tests/func/phpunit-selenium.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/bash
-
-set -ex
-
-usage () {
- echo "Usage: $0 <install_method>/<install_os> testsuite_name"
- echo "Example: $0 src/centos6"
-}
-
-TEST_ENV="$1"
-# Test arg
-if [ -z "$TEST_ENV" ]
-then
- usage
- exit 1
-fi
-shift
-
-export INSTALL_METHOD=${TEST_ENV%/*}
-export INSTALL_OS=${TEST_ENV#*/}
-
-if [ -z "$INSTALL_METHOD" ] || [ -z "$INSTALL_OS" ] ; then
- usage
- exit 1
-fi
-
-case $INSTALL_METHOD in
- rpm|src|deb)
- ;;
- *)
- echo "Unknown install method"
- exit 1
- ;;
-esac
-
-case $INSTALL_OS in
- debian*|centos*)
- ;;
- *)
- echo "Unknown install OS"
- exit 1
- ;;
-esac
-
-HOST=$(hostname -f)
-
-
-# Initialize defaults
-. $(dirname $0)/../buildbot/config/default
-FORGE_HOME=$(cd $(dirname $0)/../..; pwd)
-cd $FORGE_HOME
-
-SELENIUM_RC_DIR=/var/log
-SELENIUM_RC_HOST=$HOST
-# URL for screenshots - cf. http://buildbot.fusionforge.org/env-vars.html
-SELENIUM_RC_URL=${JOB_URL}/ws/method/${INSTALL_METHOD}/os/${INSTALL_OS}/reports/
-# config.php will be loaded inside the functionnal test suite with
-# require_once, in SeleniumForge.php
-export SELENIUM_RC_DIR SELENIUM_RC_URL SELENIUM_RC_HOST HOST
-
-# Add definitions for the PHP functionnal test suite
-cat <<-EOF >tests/func/config.php
-<?php
-// Host where selenium-rc is running
-define ('SELENIUM_RC_HOST', getenv('SELENIUM_RC_HOST'));
-define ('SELENIUM_RC_DIR', getenv('SELENIUM_RC_DIR'));
-
-// The forge's hostname
-define ('HOST', getenv('HOST'));
-
-// Base URL where FusionForge is installed
-define ('ROOT', '');
-
-// Cronjob wrapper script location
-print "Looking for forge_run_job script...\n";
-if (is_executable ("$FORGE_HOME/bin/forge_run_job")) {
- print "Found in $FORGE_HOME/bin/\n";
- define('RUN_JOB_PATH', "$FORGE_HOME/bin/");
-} elseif (is_executable ("$FORGE_HOME/bin/forge_run_job")) {
- print "Found in $FORGE_HOME/bin/\n";
- define('RUN_JOB_PATH', "$FORGE_HOME/bin/");
-} elseif (is_executable ("$FORGE_HOME/src/bin/forge_run_job")) {
- print "Found in $FORGE_HOME/src/bin/\n";
- define('RUN_JOB_PATH', "$FORGE_HOME/src/bin/");
-} else {
- print "Neither $FORGE_HOME/bin/forge_run_job, nor
$FORGE_HOME/bin/forge_run_job, nor $FORGE_HOME/src/bin/forge_run_job seem to be
executable, strange.\n";
- exit(1);
-}
-
-define('INSTALL_METHOD', getenv('INSTALL_METHOD'));
-define('INSTALL_OS', getenv('INSTALL_OS'));
-
-//
-// DON'T MODIFY BELOW THIS LINE UNLESS YOU KNOW WHAT YOU DO
-//
-
-// These are deduced from the previous definitions.
-
-// URL to access the application
-define ('URL', 'http://'.HOST.'/');
-
-// WSDL of the forges SOAP API
-define ('WSDL_URL', URL.'soap/index.php?wsdl');
-EOF
-
-echo "Starting Selenium"
-killall -9 java || true
-timeout=60
-PATH=/usr/lib/iceweasel:/usr/lib64/firefox:$PATH LANG=C java -jar
/usr/share/selenium/selenium-server.jar -trustAllSSLCertificates -singleWindow &
-pid=$!
-i=0
-while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
- echo "Waiting for Selenium..."
- sleep 1
- i=$(($i+1))
-done
-if [ $i = $timeout ]; then
- echo "Selenium failed to start listener… lacking entropy? Trying again."
- find / > /dev/null 2> /dev/null &
- i=0
- while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
- echo "Waiting for Selenium..."
- sleep 1
- i=$(($i+1))
- done
-fi
-if [ $i = $timeout ] || ! kill -0 $pid 2>/dev/null; then
- echo "Selenium failed to start!"
- netstat -tnl
- kill -9 $pid
- exit 1
-fi
-
-echo "Running PHPunit tests"
-retcode=0
-cd tests
-set -x
-if [ "$*" = "" ] ; then
- phpunit --verbose --debug --stop-on-failure --log-junit
$SELENIUM_RC_DIR/phpunit-selenium.xml func_tests.php || retcode=$?
-else
- phpunit --verbose --debug --stop-on-failure --log-junit
$SELENIUM_RC_DIR/phpunit-selenium.xml "$@" || retcode=$?
-fi
-set +x
-echo "phpunit returned with code $retcode"
-
-set +e
-kill $pid
-killall -9 firefox-bin # debian
-killall -9 firefox # centos
-killall -9 java # kill java stuffs
-exit $retcode
diff --git a/tests/func/run-testsuite.sh b/tests/func/run-testsuite.sh
deleted file mode 100755
index 45a937b..0000000
--- a/tests/func/run-testsuite.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/bash
-# Run FusionForge's PHPUnit+Selenium testsuite
-#
-# Copyright (C) 2011 Olivier Berger - Institut Telecom
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-set -ex
-export DEBIAN_FRONTEND=noninteractive
-
-if [ -z "$1" ]; then
- set +x
- echo "Usage:"
- echo " $0 src/debian"
- echo " $0 deb/debian"
- echo " $0 src/centos"
- echo " $0 rpm/centos"
- exit 1
-fi
-
-# Selenium dependencies and test dependencies
-# psmisc for db_reload.sh:killall
-# rsyslog to get e.g. sshd error log
-if [ -e /etc/debian_version ]; then
- apt-get -y install wget default-jre iceweasel
- apt-get -y install phpunit phpunit-selenium patch psmisc patch rsyslog
-else
- yum -y install wget firefox
- if yum list java-1.7.0-openjdk >/dev/null 2>&1 ; then
- yum install -y java-1.7.0-openjdk
- else
- yum install -y java-1.6.0
- fi
- yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc patch net-tools
-fi
-
-# Install selenium (no packaged version available)
-SELENIUMMAJOR=2
-SELENIUMMINOR=42
-SELENIUMMICRO=2
-SELENIUMURL=http://selenium-release.storage.googleapis.com/$SELENIUMMAJOR.$SELENIUMMINOR/selenium-server-standalone-$SELENIUMMAJOR.$SELENIUMMINOR.$SELENIUMMICRO.jar
-mkdir -p /usr/share/selenium/
-http_proxy=$PROXY wget -c $SELENIUMURL \
- -O /usr/share/selenium/selenium-server.jar
-
-service cron stop || true
-
-# Add alias to /etc/hosts
-if ! grep -q ^$(hostname -i) /etc/hosts ; then
- echo $(hostname -i) $(hostname) >> /etc/hosts
-fi
-grep -q "^$(hostname -i).*$(forge_get_config scm_host)" /etc/hosts || sed -i
-e "s/^$(hostname -i).*/& $(forge_get_config scm_host)/" /etc/hosts
-
-# Fix screenshot default black background (/usr/share/{php,pear}) (fix
available upstream)
-patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php <<'EOF' || true
---- /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php-dist
2014-02-10 19:48:34.000000000 +0000
-+++ /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php 2014-09-01
10:09:38.823051288 +0000
-@@ -1188,7 +1188,7 @@
- !empty($this->screenshotUrl)) {
- $filename = $this->getScreenshotPath() . $this->testId . '.png';
-
-- $this->drivers[0]->captureEntirePageScreenshot($filename);
-+ $this->drivers[0]->captureEntirePageScreenshot($filename,
'background=#CCFFDD');
-
- return 'Screenshot: ' . $this->screenshotUrl . '/' .
- $this->testId . ".png\n";
-EOF
-
-# Reset the database to post-install state
-$(dirname $0)/db_reload.sh --reset
-$(dirname $0)/db_reload.sh --backup
-
-# Now, start the functionnal test suite using phpunit and selenium
-$(dirname $0)/phpunit-selenium.sh $@
diff --git a/tests/func/vnc-run-testsuite.sh b/tests/func_tests-xvnc.sh
similarity index 77%
rename from tests/func/vnc-run-testsuite.sh
rename to tests/func_tests-xvnc.sh
index d30ba8c..23b2a40 100755
--- a/tests/func/vnc-run-testsuite.sh
+++ b/tests/func_tests-xvnc.sh
@@ -2,9 +2,9 @@
# Wrapper to run the testsuite in a headless X server
if [ -z "$1" ]; then
- echo "$(basename $0): run a program in a headless X server"
- echo "Usage: $0 program [params]"
- echo "Ex: $0 $(dirname $0)/run-testsuite.sh deb/debian"
+ echo "$(basename $0): run the testsuite in a headless X server"
+ echo "Usage: $0 [params]"
+ echo "Ex: $0 deb/debian"
exit 1
fi
@@ -34,7 +34,7 @@ password
EOF
vncserver :1
-DISPLAY=:1 $@
+DISPLAY=:1 $(dirname $0)/func_tests.sh $@
retcode=$?
vncserver -kill :1 || retcode=$?
diff --git a/tests/func_tests.php b/tests/func_tests.php
index a87a0d7..b3b1c57 100644
--- a/tests/func_tests.php
+++ b/tests/func_tests.php
@@ -21,9 +21,9 @@ class AllTests
// Selenium tests
if (getenv('TESTGLOB') != FALSE)
- $files = glob(getenv('TESTGLOB'));
+ $files = glob(dirname(__FILE__).'/'.getenv('TESTGLOB'));
else
- $files = glob('func/*/*Test.php');
+ $files = glob(dirname(__FILE__).'/func/*/*Test.php');
natsort($files);
$suite->addTestFiles($files);
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
new file mode 100755
index 0000000..687c4b9
--- /dev/null
+++ b/tests/func_tests.sh
@@ -0,0 +1,195 @@
+#!/bin/bash
+# Run FusionForge's PHPUnit+Selenium testsuite
+#
+# Copyright (C) 2011 Olivier Berger - Institut Telecom
+# Copyright (C) 2014, 2015 Inria (Sylvain Beucler)
+#
+# This file is part of FusionForge. FusionForge is free software;
+# you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the Licence, or (at your option)
+# any later version.
+#
+# FusionForge is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with FusionForge; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -ex
+export DEBIAN_FRONTEND=noninteractive
+
+if [ -z "$1" ]; then
+ set +x
+ echo "Usage:"
+ echo " $0 src/debian"
+ echo " $0 deb/debian"
+ echo " $0 src/centos"
+ echo " $0 rpm/centos"
+ exit 1
+fi
+
+export INSTALL_METHOD=${1%/*}
+export INSTALL_OS=${1#*/}
+shift
+
+case $INSTALL_METHOD in
+ rpm|src|deb) ;;
+ *) echo "Unknown install method"
+ exit 1 ;;
+esac
+
+case $INSTALL_OS in
+ debian*|centos*) ;;
+ *) echo "Unknown install OS"
+ exit 1 ;;
+esac
+
+
+install_selenium() {
+ # Selenium dependencies and test dependencies
+ # psmisc for db_reload.sh:killall
+ # rsyslog to get e.g. sshd error log
+ if [ -e /etc/debian_version ]; then
+ apt-get -y install wget default-jre iceweasel
+ apt-get -y install phpunit phpunit-selenium patch psmisc patch rsyslog
+ else
+ yum -y install wget firefox
+ if yum list java-1.7.0-openjdk >/dev/null 2>&1 ; then
+ yum install -y java-1.7.0-openjdk
+ else
+ yum install -y java-1.6.0
+ fi
+ yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc patch net-tools
+ fi
+
+ # Install selenium (no packaged version available)
+ SELENIUMMAJOR=2
+ SELENIUMMINOR=42
+ SELENIUMMICRO=2
+
SELENIUMURL=http://selenium-release.storage.googleapis.com/$SELENIUMMAJOR.$SELENIUMMINOR/selenium-server-standalone-$SELENIUMMAJOR.$SELENIUMMINOR.$SELENIUMMICRO.jar
+ mkdir -p /usr/share/selenium/
+ http_proxy=$PROXY wget -c $SELENIUMURL \
+ -O /usr/share/selenium/selenium-server.jar
+
+ # Add alias to /etc/hosts
+ if ! grep -q ^$(hostname -i) /etc/hosts ; then
+ echo $(hostname -i) $(hostname) >> /etc/hosts
+ fi
+ grep -q "^$(hostname -i).*$(forge_get_config scm_host)" /etc/hosts || sed
-i -e "s/^$(hostname -i).*/& $(forge_get_config scm_host)/" /etc/hosts
+
+ # Fix screenshot default black background (/usr/share/{php,pear}) (fix
available upstream)
+ patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php <<'EOF' ||
true
+--- /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php-dist
2014-02-10 19:48:34.000000000 +0000
++++ /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php 2014-09-01
10:09:38.823051288 +0000
+@@ -1188,7 +1188,7 @@
+ !empty($this->screenshotUrl)) {
+ $filename = $this->getScreenshotPath() . $this->testId . '.png';
+
+- $this->drivers[0]->captureEntirePageScreenshot($filename);
++ $this->drivers[0]->captureEntirePageScreenshot($filename,
'background=#CCFFDD');
+
+ return 'Screenshot: ' . $this->screenshotUrl . '/' .
+ $this->testId . ".png\n";
+EOF
+}
+
+
+install_selenium
+
+service cron stop || true
+
+# Reset the database and repos to post-install/pristine state
+$(dirname $0)/func/fixtures.sh --reset
+$(dirname $0)/func/fixtures.sh --backup
+
+
+HOST=$(hostname -f)
+FORGE_HOME=$(cd $(dirname $0)/..; pwd)
+
+SELENIUM_RC_DIR=/var/log
+SELENIUM_RC_HOST=$HOST
+# URL for screenshots - cf. http://buildbot.fusionforge.org/env-vars.html
+SELENIUM_RC_URL=${JOB_URL}/ws/method/${INSTALL_METHOD}/os/${INSTALL_OS}/reports/
+# config.php will be loaded inside the functionnal test suite with
+# require_once, in SeleniumForge.php
+export SELENIUM_RC_DIR SELENIUM_RC_URL SELENIUM_RC_HOST HOST
+
+# Add definitions for the PHP functionnal test suite
+cat <<-EOF >$(dirname $0)/func/config.php
+<?php
+// Host where selenium-rc is running
+define ('SELENIUM_RC_HOST', getenv('SELENIUM_RC_HOST'));
+define ('SELENIUM_RC_DIR', getenv('SELENIUM_RC_DIR'));
+
+// The forge's hostname
+define ('HOST', getenv('HOST'));
+
+// Base URL where FusionForge is installed
+define ('ROOT', '');
+
+define('INSTALL_METHOD', getenv('INSTALL_METHOD'));
+define('INSTALL_OS', getenv('INSTALL_OS'));
+
+//
+// DON'T MODIFY BELOW THIS LINE UNLESS YOU KNOW WHAT YOU DO
+//
+
+// These are deduced from the previous definitions.
+
+// URL to access the application
+define ('URL', 'http://'.HOST.'/');
+
+// WSDL of the forges SOAP API
+define ('WSDL_URL', URL.'soap/index.php?wsdl');
+EOF
+
+echo "Starting Selenium"
+killall -9 java || true
+timeout=60
+PATH=/usr/lib/iceweasel:/usr/lib64/firefox:$PATH LANG=C java -jar
/usr/share/selenium/selenium-server.jar -trustAllSSLCertificates -singleWindow &
+pid=$!
+i=0
+while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
+ echo "Waiting for Selenium..."
+ sleep 1
+ i=$(($i+1))
+done
+if [ $i = $timeout ]; then
+ echo "Selenium failed to start listener… lacking entropy? Trying again."
+ find / > /dev/null 2> /dev/null &
+ i=0
+ while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
+ echo "Waiting for Selenium..."
+ sleep 1
+ i=$(($i+1))
+ done
+fi
+if [ $i = $timeout ] || ! kill -0 $pid 2>/dev/null; then
+ echo "Selenium failed to start!"
+ netstat -tnl
+ kill -9 $pid
+ exit 1
+fi
+
+echo "Running PHPunit tests"
+retcode=0
+set -x
+cd $(dirname $0)/
+if [ "$*" = "" ] ; then
+ phpunit --verbose --debug --stop-on-failure --log-junit
$SELENIUM_RC_DIR/phpunit-selenium.xml func_tests.php || retcode=$?
+else
+ phpunit --verbose --debug --stop-on-failure --log-junit
$SELENIUM_RC_DIR/phpunit-selenium.xml "$@" || retcode=$?
+fi
+set +x
+echo "phpunit returned with code $retcode"
+
+set +e
+kill $pid
+killall -9 firefox-bin # debian
+killall -9 firefox # centos
+killall -9 java # kill java stuffs
+exit $retcode
-----------------------------------------------------------------------
Summary of changes:
autoinstall/install-src.sh | 3 -
tests/README | 2 +
tests/buildbot/config/default | 6 +-
tests/buildbot/fusionforge-func_tests.sh | 2 +-
tests/func/SeleniumForge.php | 13 +-
tests/func/{db_reload.sh => fixtures.sh} | 3 -
tests/func/phpunit-selenium.sh | 151 ----------------
tests/func/run-testsuite.sh | 88 ----------
.../vnc-run-testsuite.sh => func_tests-xvnc.sh} | 8 +-
tests/func_tests.php | 4 +-
tests/func_tests.sh | 195 +++++++++++++++++++++
11 files changed, 211 insertions(+), 264 deletions(-)
rename tests/func/{db_reload.sh => fixtures.sh} (99%)
delete mode 100755 tests/func/phpunit-selenium.sh
delete mode 100755 tests/func/run-testsuite.sh
rename tests/{func/vnc-run-testsuite.sh => func_tests-xvnc.sh} (77%)
create mode 100755 tests/func_tests.sh
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits