6 echo "You must give the testsuite to run :"
7 echo " - DEBDebian60Tests.php"
8 echo " - RPMCentos52Tests.php"
9 echo " - TarCentos52Tests.php"
11 if [ "x$testsuite" = "x" ]
13 echo "Forge test suite not found"
18 [ ! -f $WORKSPACE/config/phpunit ] || . $WORKSPACE/config/phpunit
19 SELENIUM_RC_DIR=$WORKSPACE/reports
20 [ -d $WORKSPACE/reports ] || mkdir $WORKSPACE/reports
21 SELENIUM_RC_URL=${HUDSON_URL}job/${JOB_NAME}/ws/reports
22 SELENIUM_RC_HOST=`hostname -f`
24 CONFIG_PHP=func/config.php
25 export SELENIUM_RC_DIR WORKSPACE SELENIUM_RC_URL SELENIUM_RC_HOST HOST DB_NAME CONFIG_PHP
27 cat <<-EOF >tests/func/config.php
29 // Host where selenium-rc is running
30 define ('SELENIUM_RC_HOST', getenv('SELENIUM_RC_HOST'));
31 define ('SELENIUM_RC_DIR', getenv('SELENIUM_RC_DIR'));
33 // The forge's hostname
34 define ('HOST', getenv('HOST'));
36 // Base URL where FusionForge is installed
39 // Database connection parameters.
40 define('DB_NAME', getenv('DB_NAME'));
41 define('DB_USER', 'gforge');
42 define('DB_PASSWORD', '@@FFDB_PASS@@');
43 define('DB_INIT_CMD', "/root/tests/func/db_reload.sh >/var/log/db_reload.log 2>/var/log/db_reload.errlog");
45 // this should be an existing user of the forge together with its password
46 // (the password should be different from 'myadmin')
47 define ('EXISTING_USER', 'admin');
48 define ('PASSWD_OF_EXISTING_USER', 'myadmin');
50 // Where CLI is installed
51 define ('CLI_CMD', '/opt/gforge/acde/tools/gforge-cli/gforge.php');
53 // Where Java CLI is installed
54 define ('JAGOSI_CMD', '/opt/gforge/acde/tools/gforge-java-cli/');
56 // Enter true when file is configured.
57 define('CONFIGURED', getenv('CONFIGURED'));
60 // DON'T MODIFY BELOW THIS LINE UNLESS YOU KNOW WHAT YOU DO
63 // These are deduced from the previous definitions.
65 // URL to access the application
66 define ('URL', 'http://'.HOST.'/');
68 // WSDL of the forges SOAP API
69 define ('WSDL_URL', URL.'soap/index.php?wsdl');
74 echo "This will run phpunit tests"
76 LANG=C java -jar selenium-server.jar -browserSessionReuse -singleWindow >/dev/null &
77 #LANG=C java -jar selenium-server.jar -singleWindow >/dev/null &
79 phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml $testsuite || retcode=$?
82 killall -9 firefox-bin