[Fusionforge-commits] FusionForge branch master updated. e14d1194e7d92bd27f388cab767807a9bca35330

Sylvain Beucler beuc-inria at fusionforge.org
Thu Jan 15 12:01:56 CET 2015


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, master has been updated
       via  e14d1194e7d92bd27f388cab767807a9bca35330 (commit)
      from  1091c4af1ac1f5b718fc178f2a04cc7b47d1815b (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 -----------------------------------------------------------------
commit e14d1194e7d92bd27f388cab767807a9bca35330
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Thu Jan 15 11:22:48 2015 +0100

    testsuite: better logging and timeout handling for svnwebdav

diff --git a/tests/func/50_PluginsScmSvn/svnWebDAVTest.php b/tests/func/50_PluginsScmSvn/svnWebDAVTest.php
index 760b07b..0a03307 100644
--- a/tests/func/50_PluginsScmSvn/svnWebDAVTest.php
+++ b/tests/func/50_PluginsScmSvn/svnWebDAVTest.php
@@ -23,6 +23,16 @@ require_once dirname(dirname(__FILE__)).'/Testing/SeleniumForge.php';
 
 class ScmSvnWebDAVTest extends FForge_SeleniumTestCase
 {
+	// Retry Git/SVN commands over HTTP if they timeout at first (?)
+    function runCommandTimeout($dir, $command) {
+		system("cd $dir && timeout 15s $command", $ret);
+		if ($ret == 124) {	# retry once if we get a timeout
+			system("cd $dir && timeout 15s $command", $ret);
+		}
+		ob_flush();
+		$this->assertEquals($ret, 0);
+	}
+
 	function testScmSvnWebDAV()
 	{
         $this->changeConfig("[scmsvn]\nuse_ssl = no\n");
@@ -56,27 +66,14 @@ class ScmSvnWebDAVTest extends FForge_SeleniumTestCase
 		$t = exec("mktemp -d /tmp/svnTest.XXXXXX");
 		$auth = "--username ".FORGE_ADMIN_USERNAME." --password ".FORGE_ADMIN_PASSWORD;
 		$globalopts = "--trust-server-cert --non-interactive";
-		$log = "2> /var/log/svn.stderr > /var/log/svn.stdout";
-		$timeout = "timeout 15s";
-		system("cd $t && $timeout svn checkout $globalopts $auth $p projecta $log", $ret);
-		if ($ret > 120) {
-			system("cd $t && $timeout svn checkout $globalopts $auth $p projecta $log", $ret);
-		}
-		$this->assertEquals($ret, 0);
+		$this->runCommandTimeout($t, "svn checkout $globalopts $auth $p projecta");
 		sleep(2);
-		system("echo 'this is a simple text' > $t/projecta/mytext.txt");
-		system("cd $t/projecta && $timeout svn add mytext.txt $log && $timeout svn commit $globalopts $auth -m'Adding file' $log", $ret);
-		if ($ret > 120) {
-			system("cd $t/projecta && $timeout svn add mytext.txt $log && $timeout svn commit $globalopts $auth -m'Adding file' $log", $ret);
-		}
-		$this->assertEquals($ret, 0);
+		$this->runCommand("echo 'this is a simple text' > $t/projecta/mytext.txt");
+		$this->runCommandTimeout("$t/projecta", "svn add mytext.txt");
+		$this->runCommandTimeout("$t/projecta", "svn commit $globalopts $auth -m'Adding file'");
 		sleep(2);
-		system("echo 'another simple text' >> $t/projecta/mytext.txt");
-		system("cd $t/projecta && $timeout svn commit $globalopts $auth -m'Modifying file' $log", $ret);
-		if ($ret > 120) {
-			system("cd $t/projecta && $timeout svn commit $globalopts $auth -m'Modifying file' $log", $ret);
-		}
-		$this->assertEquals($ret, 0);
+		$this->runCommand("echo 'another simple text' >> $t/projecta/mytext.txt");
+		$this->runCommandTimeout("$t/projecta", "svn commit $globalopts $auth -m'Modifying file'");
 		sleep(2);
 
 		// Check that the changes appear in svnweb
@@ -105,4 +102,3 @@ class ScmSvnWebDAVTest extends FForge_SeleniumTestCase
 	}
 
 }
-?>

-----------------------------------------------------------------------

Summary of changes:
 tests/func/50_PluginsScmSvn/svnWebDAVTest.php |   36 +++++++++++--------------
 1 file changed, 16 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list