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  f371807e6e8816cfbeeeea30c40f44d0561b7bb4 (commit)
      from  5038ad5c5c4eeccee5798fb1665e2fdfc23eccdd (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 f371807e6e8816cfbeeeea30c40f44d0561b7bb4
Author: Roland Mas <[email protected]>
Date:   Thu Apr 9 14:39:45 2015 +0200

    Reuse factored method to run a command with a timeout

diff --git a/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php 
b/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php
index c3adcc2..d20f948 100644
--- a/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php
+++ b/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php
@@ -49,33 +49,18 @@ class ScmGitSmartHTTPTest extends FForge_SeleniumTestCase
                $p = $this->getText("//tt[contains(.,'git clone http') and 
contains(.,'".FORGE_ADMIN_USERNAME."@')]");
                $p = preg_replace(",^git clone ,", "", $p);
                $p = preg_replace(",@,", ":".FORGE_ADMIN_PASSWORD."@", $p);
-               $timeout = "timeout 15s";
 
                // Create a local clone, add stuff, push it to the repo
                $t = exec("mktemp -d /tmp/gitTest.XXXXXX");
-               system("cd $t && GIT_SSL_NO_VERIFY=true $timeout git clone 
--quiet $p", $ret);
-               if ($ret >= 120) {
-                       system("cd $t && GIT_SSL_NO_VERIFY=true $timeout git 
clone --quiet $p", $ret);
-               }
-               if ($ret >= 120) {
-                       system("cd $t && GIT_SSL_NO_VERIFY=true $timeout git 
clone --quiet $p", $ret);
-               }
-               $this->assertEquals(0, $ret);
+               $this->runCommandTimeout($t, "GIT_SSL_NO_VERIFY=true git clone 
--quiet $p");
 
                system("echo 'this is a simple text' > $t/projecta/mytext.txt");
-               system("cd $t/projecta && $timeout git add mytext.txt && 
$timeout git commit --quiet -a -m'Adding file'", $ret);
+               system("cd $t/projecta && git add mytext.txt && git commit 
--quiet -a -m'Adding file'", $ret);
                system("echo 'another simple text' >> $t/projecta/mytext.txt");
                system("cd $t/projecta && git commit --quiet -a -m'Modifying 
file'", $ret);
                $this->assertEquals(0, $ret);
 
-               system("cd $t/projecta && GIT_SSL_NO_VERIFY=true $timeout git 
push --quiet --all", $ret);
-               if ($ret >= 120) {
-                       system("cd $t/projecta && GIT_SSL_NO_VERIFY=true 
$timeout git push --quiet --all", $ret);
-               }
-               if ($ret >= 120) {
-                       system("cd $t/projecta && GIT_SSL_NO_VERIFY=true 
$timeout git push --quiet --all", $ret);
-               }
-               $this->assertEquals(0, $ret);
+               $this->runCommandTimeout("$t/projecta", "GIT_SSL_NO_VERIFY=true 
git push --quiet --all");
 
                // Check that the changes appear in gitweb
                $this->open(ROOT);
diff --git a/tests/func/50_PluginsScmSvn/svnWebDAVTest.php 
b/tests/func/50_PluginsScmSvn/svnWebDAVTest.php
index 065d430..8342071 100644
--- a/tests/func/50_PluginsScmSvn/svnWebDAVTest.php
+++ b/tests/func/50_PluginsScmSvn/svnWebDAVTest.php
@@ -23,19 +23,6 @@ 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);
-               }
-               if ($ret == 124) {      # retry once if we get a timeout
-                       system("cd $dir && timeout 15s $command", $ret);
-               }
-               ob_flush();
-               $this->assertEquals(0, $ret);
-       }
-
        function testScmSvnWebDAV()
        {
         $this->changeConfig("[scmsvn]\nuse_ssl = no\n");
diff --git a/tests/func/Testing/SeleniumForge.php 
b/tests/func/Testing/SeleniumForge.php
index 7c93db1..87a744e 100644
--- a/tests/func/Testing/SeleniumForge.php
+++ b/tests/func/Testing/SeleniumForge.php
@@ -132,6 +132,19 @@ class FForge_SeleniumTestCase extends 
PHPUnit_Extensions_SeleniumTestCase
                ob_flush();
        }
 
+       function runCommandTimeout($dir, $command) {
+               $cmd = "cd $dir && timeout 15s $command";
+               system($cmd, $ret);
+               if ($ret == 124) {      # retry once if we get a timeout
+                       system($cmd, $ret);
+               }
+               if ($ret == 124) {      # retry a second time if we get a 
timeout again
+                       system($cmd, $ret);
+               }
+               $this->assertEquals(0, $ret);  # Give up
+               ob_flush();
+       }
+
        protected function db($sql)
        {
                system("echo \"$sql\" | psql -q -Upostgres ".DB_NAME);

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

Summary of changes:
 tests/func/50_PluginsScmGit/gitSmartHTTPTest.php |   21 +++------------------
 tests/func/50_PluginsScmSvn/svnWebDAVTest.php    |   13 -------------
 tests/func/Testing/SeleniumForge.php             |   13 +++++++++++++
 3 files changed, 16 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to