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  19ef4de48c6a1e3113dde2ce84f0b8be8e0a49e4 (commit)
       via  52ba58c40b72c77bad79dba6cc381bfe97412288 (commit)
      from  2b7468b4f4cd7a70697a07a459f3c47e2abe7ebe (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=19ef4de48c6a1e3113dde2ce84f0b8be8e0a49e4

commit 19ef4de48c6a1e3113dde2ce84f0b8be8e0a49e4
Author: Franck Villaume <[email protected]>
Date:   Sun Sep 17 18:22:21 2017 +0200

    tabs vs. space

diff --git a/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php 
b/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php
index dc557a3..62bba17 100644
--- a/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php
+++ b/tests/func/50_PluginsScmGit/gitSmartHTTPTest.php
@@ -76,8 +76,8 @@ class ScmGitSmartHTTPTest extends FForge_SeleniumTestCase
                $this->assertTextPresent("Adding file");
                $this->selectFrame("relative=top");
 
-        // Check gitweb directly
-        
$this->openWithOneRetry("https://scm.".HOST.ROOT."/anonscm/gitweb/?p=projecta/projecta.git";);
+               // Check gitweb directly
+               
$this->openWithOneRetry("https://scm.".HOST.ROOT."/anonscm/gitweb/?p=projecta/projecta.git";);
                $this->assertElementPresent("//.[@class='page_footer']");
                $this->assertTextPresent("projecta.git");
                $this->clickAndWait("link=projecta.git");
@@ -100,13 +100,13 @@ class ScmGitSmartHTTPTest extends FForge_SeleniumTestCase
                // Update repositories
                $this->waitSystasks();
 
-        // Check that gitweb now fails
-        
$this->openWithOneRetry("https://scm.".HOST.ROOT."/anonscm/gitweb/?p=projecta/projecta.git";);
+               // Check that gitweb now fails
+               
$this->openWithOneRetry("https://scm.".HOST.ROOT."/anonscm/gitweb/?p=projecta/projecta.git";);
                $this->assertElementPresent("//.[@class='page_footer']");
                $this->assertTextNotPresent("projecta.git");
 
-        // Now try to use the authenticated gitweb
-        
$this->openWithOneRetry("https://".FORGE_ADMIN_USERNAME.":".FORGE_ADMIN_PASSWORD."@scm.".HOST.ROOT."/authscm/".FORGE_ADMIN_USERNAME."/gitweb/?p=projecta/projecta.git";);
+               // Now try to use the authenticated gitweb
+               
$this->openWithOneRetry("https://".FORGE_ADMIN_USERNAME.":".FORGE_ADMIN_PASSWORD."@scm.".HOST.ROOT."/authscm/".FORGE_ADMIN_USERNAME."/gitweb/?p=projecta/projecta.git";);
                $this->assertElementPresent("//.[@class='page_footer']");
                $this->assertTextPresent("projecta.git");
 
@@ -149,9 +149,9 @@ class ScmGitSmartHTTPTest extends FForge_SeleniumTestCase
                $this->assertElementPresent("//.[@class='page_footer']");
                $this->assertTextNotPresent("projecta.git");
 
-        // Test accessing admin's URL with otheruser's credentials (and 
asserting we get a 401)
-        // …Selenium doesn't allow checking HTTP return codes, so use a 
file_get_contents() hack
-        // First make sure that the hack works
+               // Test accessing admin's URL with otheruser's credentials (and 
asserting we get a 401)
+               // …Selenium doesn't allow checking HTTP return codes, so use a 
file_get_contents() hack
+               // First make sure that the hack works
                $opts = array(
                        'ssl'=>array(
                                'verify_peer'=>false,
@@ -159,13 +159,12 @@ class ScmGitSmartHTTPTest extends FForge_SeleniumTestCase
                        )
                );
                $context = stream_context_create($opts);
-        $f = 
@file_get_contents("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/otheruser/gitweb/";,
 "r", $context);
-        $this->assertTrue(is_string($f));
-        $this->assertEquals(1, preg_match('/projectb.git/',$f));
-        // Then make sure we detect a failure
-        $f = 
@file_get_contents("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/".FORGE_ADMIN_USERNAME."/gitweb/projecta/";,
 "r", $context);
-        $this->assertFalse($f);
-
+               $f = 
@file_get_contents("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/otheruser/gitweb/";,
 "r", $context);
+               $this->assertTrue(is_string($f));
+               $this->assertEquals(1, preg_match('/projectb.git/',$f));
+               // Then make sure we detect a failure
+               $f = 
@file_get_contents("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/".FORGE_ADMIN_USERNAME."/gitweb/projecta/";,
 "r", $context);
+               $this->assertFalse($f);
                system("rm -fr $t");
        }
 }

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=52ba58c40b72c77bad79dba6cc381bfe97412288

commit 52ba58c40b72c77bad79dba6cc381bfe97412288
Author: Franck Villaume <[email protected]>
Date:   Sun Sep 17 18:21:58 2017 +0200

    scmhg: initial func test: create repo and check url

diff --git a/tests/func/50_PluginsScmHg/hgHTTPTest.php 
b/tests/func/50_PluginsScmHg/hgHTTPTest.php
new file mode 100644
index 0000000..8f1d1ce
--- /dev/null
+++ b/tests/func/50_PluginsScmHg/hgHTTPTest.php
@@ -0,0 +1,171 @@
+<?php
+/**
+ * Copyright (C) 2012 Roland Mas
+ * Copyright (C) 2015  Inria (Sylvain Beucler)
+ * Copyright 2017, Franck Villaume - TrivialDev
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once dirname(dirname(__FILE__)).'/SeleniumForge.php';
+
+class ScmHgHTTPTest extends FForge_SeleniumTestCase
+{
+       public $fixture = 'projecta';
+
+       function testScmHgHTTP()
+       {
+               $this->loadAndCacheFixture();
+
+               $this->activatePlugin('scmhg');
+
+               $this->open(ROOT);
+               $this->clickAndWait("link=ProjectA");
+               $this->clickAndWait("link=Admin");
+               $this->clickAndWait("link=Tools");
+               $this->clickAndWait("link=Source Code Admin");
+               $this->click("//input[@name='scmengine[]' and @value='scmhg']");
+               $this->clickAndWait("submit");
+
+               // Create repositories
+               $this->waitSystasks();
+
+               // Get the address of the repo
+               $this->open(ROOT);
+               $this->clickAndWait("link=ProjectA");
+               $this->clickAndWait("link=SCM");
+               $p = $this->getText("//kbd[contains(.,'hg clone http') and 
contains(.,'".FORGE_ADMIN_USERNAME."@')]");
+               $p = preg_replace(",^hg clone ,", "", $p);
+               $p = preg_replace(",@,", ":".FORGE_ADMIN_PASSWORD."@", $p);
+
+               // Create a local clone, add stuff, push it to the repo
+//             $t = exec("mktemp -d /tmp/hgTest.XXXXXX");
+//             $this->runCommandTimeout($t, "hg clone --quiet $p", 
"GIT_SSL_NO_VERIFY=true");
+// 
+//             system("echo 'this is a simple text' > $t/projecta/mytext.txt");
+//             system("cd $t/projecta && hg add mytext.txt && hg commit 
--quiet -a -m'Adding file'", $ret);
+//             system("echo 'another simple text' >> $t/projecta/mytext.txt");
+//             system("cd $t/projecta && hg commit --quiet -a -m'Modifying 
file'", $ret);
+//             $this->assertEquals(0, $ret);
+// 
+//             $this->runCommandTimeout("$t/projecta", "hg push --quiet 
--all", "GIT_SSL_NO_VERIFY=true");
+// 
+//             // Check that the changes appear in gitweb
+//             $this->open(ROOT);
+//             $this->clickAndWait("link=ProjectA");
+//             $this->clickAndWait("link=SCM");
+//             $this->clickAndWait("link=Browse main hg repository");
+//             $this->selectFrame("id=scmgit_iframe");
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextPresent("projecta.git");
+//             $this->clickAndWait("link=projecta.git");
+//             $this->assertTextPresent("Modifying file");
+//             $this->assertTextPresent("Adding file");
+//             $this->selectFrame("relative=top");
+
+               // Check gitweb directly
+//             
$this->openWithOneRetry("https://scm.".HOST.ROOT."/anonscm/gitweb/?p=projecta/projecta.git";);
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextPresent("projecta.git");
+//             $this->clickAndWait("link=projecta.git");
+//             $this->assertTextPresent("Modifying file");
+//             $this->assertTextPresent("Adding file");
+// 
+//             // Disable anonymous access to gitweb
+//             $this->openWithOneRetry(ROOT);
+//             $this->clickAndWait("link=ProjectA");
+//             $this->click("link=Admin");
+//             $this->waitForPageToLoad("30000");
+//             $this->assertTrue($this->isTextPresent("Project Information"));
+//             $this->click("link=Users and permissions");
+//             $this->waitForPageToLoad("30000");
+//             $this->assertTrue($this->isTextPresent("Current Project 
Members"));
+//             
$this->click("//tr/td/form/div[contains(.,'Anonymous')]/../../../td/form/div/input[contains(@value,'Unlink
 Role')]");
+//             $this->waitForPageToLoad("30000");
+//             $this->assertTrue($this->isTextPresent("Role unlinked 
successfully"));
+// 
+//             // Update repositories
+//             $this->waitSystasks();
+
+               // Check that gitweb now fails
+//             
$this->openWithOneRetry("https://scm.".HOST.ROOT."/anonscm/gitweb/?p=projecta/projecta.git";);
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextNotPresent("projecta.git");
+// 
+//             // Now try to use the authenticated gitweb
+//             
$this->openWithOneRetry("https://".FORGE_ADMIN_USERNAME.":".FORGE_ADMIN_PASSWORD."@scm.".HOST.ROOT."/authscm/".FORGE_ADMIN_USERNAME."/gitweb/?p=projecta/projecta.git";);
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextPresent("projecta.git");
+// 
+//             // Also check via the standard page
+//             $this->openWithOneRetry(ROOT);
+//             $this->clickAndWait("link=ProjectA");
+//             $this->clickAndWait("link=SCM");
+//             $this->clickAndWait("link=Browse main git repository");
+//             $this->selectFrame("id=scmgit_iframe");
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextPresent("projecta.git");
+//             $this->clickAndWait("link=projecta.git");
+//             $this->assertTextPresent("Modifying file");
+//             $this->assertTextPresent("Adding file");
+//             $this->selectFrame("relative=top");
+// 
+//             // Set up a different user
+//             $this->createUser ('otheruser') ;
+//             $this->createAndGoto ('projectb');
+//             $this->clickAndWait("link=Admin");
+//             $this->clickAndWait("link=Users and permissions");
+//             $this->type 
("//form[contains(@action,'users.php')]//input[@name='form_unix_name' and 
@type='text']", "otheruser") ;
+//             $this->select("//input[@value='Add 
Member']/../fieldset/select[@name='role_id']", "label=Admin");
+//             $this->clickAndWait ("//input[@value='Add Member']") ;
+//             $this->assertTrue($this->isTextPresent("otheruser Lastname"));
+//             
$this->assertTrue($this->isElementPresent("//tr/td/a[.='otheruser 
Lastname']/../../td/div[contains(.,'Admin')]")) ;
+//             
$this->clickAndWait("//tr/td/form/div[contains(.,'Anonymous')]/../../../td/form/div/input[contains(@value,'Unlink
 Role')]");
+//             $this->assertTrue($this->isTextPresent("Role unlinked 
successfully"));
+// 
+//             $this->clickAndWait("link=Tools");
+//             $this->clickAndWait("link=Source Code Admin");
+//             $this->click("//input[@name='scmengine[]' and 
@value='scmgit']");
+//             $this->clickAndWait("submit");
+// 
+//             // Create repositories
+//             $this->waitSystasks();
+// 
+//             // Try with a different user
+//             
$this->openWithOneRetry("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/otheruser/gitweb/?p=projecta/projecta.git";);
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextNotPresent("projecta.git");
+// 
+//             // Test accessing admin's URL with otheruser's credentials (and 
asserting we get a 401)
+//             // …Selenium doesn't allow checking HTTP return codes, so use a 
file_get_contents() hack
+//             // First make sure that the hack works
+//             $opts = array(
+//                     'ssl'=>array(
+//                             'verify_peer'=>false,
+//                             'verify_peer_name'=>false,
+//                     )
+//             );
+//             $context = stream_context_create($opts);
+//             $f = 
@file_get_contents("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/otheruser/gitweb/";,
 "r", $context);
+//             $this->assertTrue(is_string($f));
+//             $this->assertEquals(1, preg_match('/projectb.git/',$f));
+//             // Then make sure we detect a failure
+//             $f = 
@file_get_contents("https://otheruser:".FORGE_OTHER_PASSWORD."@scm.".HOST.ROOT."/authscm/".FORGE_ADMIN_USERNAME."/gitweb/projecta/";,
 "r", $context);
+//             $this->assertFalse($f);
+//             system("rm -fr $t");
+       }
+}
diff --git a/tests/func/50_PluginsScmHg/hgSSHTest.php 
b/tests/func/50_PluginsScmHg/hgSSHTest.php
new file mode 100644
index 0000000..34ebcea
--- /dev/null
+++ b/tests/func/50_PluginsScmHg/hgSSHTest.php
@@ -0,0 +1,97 @@
+<?php
+/*
+ * Copyright (C) 2012 Roland Mas
+ * Copyright (C) 2015  Inria (Sylvain Beucler)
+ * Copyright 2017, Franck Villaume - TrivialDev
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once dirname(dirname(__FILE__)).'/SeleniumForge.php';
+
+class ScmHgSSHTest extends FForge_SeleniumTestCase
+{
+       public $fixture = 'projecta';
+
+       function testScmHgSSH()
+       {
+               $this->loadAndCacheFixture();
+
+               $this->activatePlugin('scmhg');
+
+               $this->open(ROOT);
+               $this->clickAndWait("link=ProjectA");
+               $this->clickAndWait("link=Admin");
+               $this->clickAndWait("link=Tools");
+               $this->clickAndWait("link=Source Code Admin");
+               $this->check("//input[@name='scmengine[]' and @value='scmhg']");
+               $this->clickAndWait("submit");
+
+               $this->uploadSshKey();
+
+               // Run the cronjob to create repositories
+               $this->waitSystasks();
+
+               // Get the address of the repo
+               $this->open(ROOT);
+               $this->clickAndWait("link=ProjectA");
+               $this->clickAndWait("link=SCM");
+               $p = $this->getText("//kbd[contains(.,'hg clone ssh')]");
+               $p = preg_replace(",^hg clone ,", "", $p);
+
+//             // Create a local clone, add stuff, push it to the repo
+//             system("git config --global core.askpass ''", $ret);
+//             $this->assertEquals(0, $ret);
+//             $t = exec("mktemp -d /tmp/gitTest.XXXXXX");
+//             system("cd $t && git clone --quiet $p", $ret);
+//             $this->assertEquals(0, $ret);
+// 
+//             system("echo 'this is a simple text' > $t/projecta/mytext.txt");
+//             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 push --quiet --all", $ret);
+//             $this->assertEquals(0, $ret);
+// 
+//             // Check that the changes appear in gitweb
+//             $this->open(ROOT);
+//             $this->clickAndWait("link=ProjectA");
+//             $this->clickAndWait("link=SCM");
+//             $this->clickAndWait("link=Browse main git repository");
+//             $this->selectFrame("id=scmgit_iframe");
+//             $this->assertElementPresent("//.[@class='page_footer']");
+//             $this->assertTextPresent("projecta.git");
+//             $this->clickAndWait("link=projecta.git");
+//             $this->assertTextPresent("Modifying file");
+//             $this->assertTextPresent("Adding file");
+//             $this->selectFrame("relative=top");
+// 
+//             // Check that the changes appear in the global activity page
+// 
+//             $this->activatePlugin('globalactivity');
+// 
+//             $this->open(ROOT.'/plugins/globalactivity/');
+//             $this->select("//select[@name='show[]']","label=Git Commits");
+//             $this->clickAndWait("submit");
+//             $this->assertTextPresent("scm commit: Modifying file");
+//             $this->assertTextPresent("scm commit: Adding file");
+// 
+//             system("rm -fr $t");
+       }
+}

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

Summary of changes:
 tests/func/50_PluginsScmGit/gitSmartHTTPTest.php |  31 ++--
 tests/func/50_PluginsScmHg/hgHTTPTest.php        | 171 +++++++++++++++++++++++
 tests/func/50_PluginsScmHg/hgSSHTest.php         |  97 +++++++++++++
 3 files changed, 283 insertions(+), 16 deletions(-)
 create mode 100644 tests/func/50_PluginsScmHg/hgHTTPTest.php
 create mode 100644 tests/func/50_PluginsScmHg/hgSSHTest.php


hooks/post-receive
-- 
FusionForge

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

Reply via email to