[Fusionforge-commits] r14592 - in branches/Branch_5_1: . src/common/include tests/scripts

Roland Mas lolando at fusionforge.org
Mon Oct 10 14:02:40 CEST 2011


Author: lolando
Date: 2011-10-10 14:02:40 +0200 (Mon, 10 Oct 2011)
New Revision: 14592

Modified:
   branches/Branch_5_1/
   branches/Branch_5_1/src/common/include/database-pgsql.php
   branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh
   branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh
   branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-source.sh
   branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-src-cos.sh
Log:
Log SQL queries when appropriate option is configured; and enable that option in buildbots

Modified: branches/Branch_5_1/src/common/include/database-pgsql.php
===================================================================
--- branches/Branch_5_1/src/common/include/database-pgsql.php	2011-10-10 08:52:17 UTC (rev 14591)
+++ branches/Branch_5_1/src/common/include/database-pgsql.php	2011-10-10 12:02:40 UTC (rev 14592)
@@ -253,6 +253,7 @@
 	if ($sysdebug_dbquery) {
 		ffDebug('trace', "tracing call of db_query_params():\n",
 		    debug_string_backtrace());
+		error_log('SQL: '.db_query_to_string($qstring,$params).'; ');
 	}
 
 	$res = @pg_query_params($dbserver,$qstring,$params);
@@ -594,15 +595,17 @@
 	return db_construct_qpa ($old_qpa, $new_qpa[0], $new_qpa[1]) ;
 }
 
-function db_qpa_to_string ($qpa) {
-	$sql = $qpa[0];
-	$params = $qpa[1];
+function db_query_to_string ($sql, $params = array()) {
 	foreach ($params as $index => $value) {
 		$sql = preg_replace('/\\$'.($index+1).'(?!\d)/', "'".$value."'", $sql);
 	}
 	return $sql;
 }	
 
+function db_qpa_to_string ($qpa) {
+	return db_query_to_string($qpa[0], $qpa[1]);
+}	
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"

Modified: branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh	2011-10-10 08:52:17 UTC (rev 14591)
+++ branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh	2011-10-10 12:02:40 UTC (rev 14592)
@@ -112,7 +112,7 @@
 echo "Set forge admin password"
 ssh root@$HOST "/usr/share/gforge/bin/forge_set_password admin $FORGE_ADMIN_PASSWORD"
 #ssh root@$HOST "LANG=C a2dissite default ; LANG=C invoke-rc.d apache2 reload ; LANG=C touch /tmp/fusionforge-use-pfo-rbac"
-ssh root@$HOST "(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-buildbot.ini"
+ssh root@$HOST "(echo [core];echo use_ssl=no;echo sysdebug_dbquery=yes) > /etc/gforge/config.ini.d/zzz-buildbot.ini"
 #ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
 ssh root@$HOST "a2dissite default"

Modified: branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh	2011-10-10 08:52:17 UTC (rev 14591)
+++ branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh	2011-10-10 12:02:40 UTC (rev 14592)
@@ -109,7 +109,7 @@
 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
 ssh root@$HOST "FFORGE_DB=$DB_NAME FFORGE_USER=gforge FFORGE_ADMIN_USER=$FORGE_ADMIN_USERNAME FFORGE_ADMIN_PASSWORD=$FORGE_ADMIN_PASSWORD export FFORGE_DB FFORGE_USER FFORGE_ADMIN_USER FFORGE_ADMIN_PASSWORD; yum install -y --skip-broken fusionforge fusionforge-plugin-scmsvn fusionforge-plugin-online_help fusionforge-plugin-extratabs fusionforge-plugin-ldapextauth fusionforge-plugin-scmgit fusionforge-plugin-blocks"
 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
-ssh root@$HOST '(echo [core];echo use_ssl=no;echo use_fti=no) > /etc/gforge/config.ini.d/zzz-buildbot.ini'
+ssh root@$HOST '(echo [core];echo use_ssl=no;echo use_fti=no;echo sysdebug_dbquery=yes) > /etc/gforge/config.ini.d/zzz-buildbot.ini'
 #ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
 #ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"

Modified: branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-source.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-source.sh	2011-10-10 08:52:17 UTC (rev 14591)
+++ branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-source.sh	2011-10-10 12:02:40 UTC (rev 14592)
@@ -109,7 +109,7 @@
 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
 ssh root@$HOST "cd fusionforge-*; FFORGE_RPM_REPO=$FFORGE_RPM_REPO DAG_RPMFORGE_REPO=$DAG_RPMFORGE_REPO FFORGE_DB=fforge FFORGE_USER=gforge FFORGE_ADMIN_USER=ffadmin FFORGE_ADMIN_PASSWORD=ffadmin ./install.sh $HOST"
 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
-ssh root@$HOST "(echo [core];echo use_ssl=no;echo use_fti=no) > /etc/gforge/config.ini.d/zzz-zbuildbot.ini"
+ssh root@$HOST "(echo [core];echo use_ssl=no;echo use_fti=no;echo sysdebug_dbquery=yes) > /etc/gforge/config.ini.d/zzz-zbuildbot.ini"
 ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
 ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
 #ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"

Modified: branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-src-cos.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-src-cos.sh	2011-10-10 08:52:17 UTC (rev 14591)
+++ branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-src-cos.sh	2011-10-10 12:02:40 UTC (rev 14592)
@@ -105,7 +105,7 @@
 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
 
 echo "Set use_ssl=no"
-ssh root@$HOST "(echo [core];echo use_ssl=no;echo use_fti=no) > /etc/gforge/config.ini.d/zzz-zbuildbot.ini"
+ssh root@$HOST "(echo [core];echo use_ssl=no;echo use_fti=no;echo sysdebug_dbquery=yes) > /etc/gforge/config.ini.d/zzz-zbuildbot.ini"
 #  Install a fake sendmail to catch all outgoing emails.
 # ssh root@$HOST "perl -spi -e s#/usr/sbin/sendmail#/opt/tests/scripts/catch_mail.php# /etc/gforge/local.inc"
 




More information about the Fusionforge-commits mailing list