[Fusionforge-commits] r12719 - trunk/tests/scripts

Christian Bayle cbayle at fusionforge.org
Sat Mar 12 16:29:37 CET 2011


Author: cbayle
Date: 2011-03-12 16:29:37 +0100 (Sat, 12 Mar 2011)
New Revision: 12719

Modified:
   trunk/tests/scripts/phpunit.sh
Log:
preliminary implementation of remote phpunit run


Modified: trunk/tests/scripts/phpunit.sh
===================================================================
--- trunk/tests/scripts/phpunit.sh	2011-03-12 14:59:25 UTC (rev 12718)
+++ trunk/tests/scripts/phpunit.sh	2011-03-12 15:29:37 UTC (rev 12719)
@@ -1,2 +1,63 @@
-#! /bin/sh
+#! /bin/sh -x
+SELENIUM_RC_DIR=/var/log
+WORKSPACE=/root
+[ -d $WORKSPACE/reports ] || mkdir $WORKSPACE/reports
+SELENIUM_RC_URL=${HUDSON_URL}job/${JOB_NAME}/ws/reports
+SELENIUM_RC_HOST=`hostname -f`
+HOST=`hostname -f`
+CONFIG_PHP=func/config.php
+export SELENIUM_RC_DIR WORKSPACE SELENIUM_RC_URL SELENIUM_RC_HOST HOST DB_NAME CONFIG_PHP
+
+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', '');
+
+// Database connection parameters.
+define('DB_NAME', getenv('DB_NAME'));
+define('DB_USER', 'gforge');
+define('DB_PASSWORD', '@@FFDB_PASS@@');
+define('DB_INIT_CMD', "/root/tests/func/db_reload.sh >/var/log/db_reload.log 2>/var/log/db_reload.errlog");
+
+// this should be an existing user of the forge together with its password
+// (the password should be different from 'myadmin')
+define ('EXISTING_USER', 'admin');
+define ('PASSWD_OF_EXISTING_USER', 'myadmin');
+
+// Where CLI is installed
+define ('CLI_CMD', '/opt/gforge/acde/tools/gforge-cli/gforge.php');
+
+// Where Java CLI is installed
+define ('JAGOSI_CMD', '/opt/gforge/acde/tools/gforge-java-cli/');
+
+// Enter true when file is configured.
+define('CONFIGURED', getenv('CONFIGURED'));
+
+//
+// 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 "This will run phpunit tests"
+killall -9 java
+LANG=C java -jar selenium-server.jar -interactive >/dev/null &
+cd tests
+phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml DEBDebian60Tests.php
+cd ..
+killall -9 java




More information about the Fusionforge-commits mailing list