From: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
To: git@vger.kernel.org
Cc: simon.cathebras@ensimag.imag.fr, Matthieu.Moy@imag.fr,
Guillaume.Sasdy@ensimag.imag.fr, Julien.Khayat@ensimag.imag.fr,
charles.roussel@ensimag.imag.fr, gitster@pobox.com,
peff@peff.net, Simon.Perrat@ensimag.imag.fr,
Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>,
Simon Perrat <simon.perrat@ensimag.imag.fr>,
Julien Khayat <julien.khayat@ensimag.imag.fr>,
Matthieu Moy <matthieu.moy@imag.fr>
Subject: [PATCHv3 4/6] Tests for git-remote-mediawiki pull
Date: Mon, 11 Jun 2012 22:28:44 +0200 [thread overview]
Message-ID: <1339446526-22397-4-git-send-email-simon.cathebras@ensimag.imag.fr> (raw)
In-Reply-To: <1339446526-22397-1-git-send-email-simon.cathebras@ensimag.imag.fr>
From: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
This patch provides a set of tests for the pull fonctionnality of
git-remote-mediawiki.
These tests are part of the file
git/contrib/mw-to-git/t/t9361-mw-to-git-pull.sh
Signed-off-by: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Julien Khayat <julien.khayat@ensimag.imag.fr>
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
Signed-off-by: Charles Roussel <charles.roussel@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@imag.fr>
---
contrib/mw-to-git/t/t9361-mw-to-git-pull.sh | 149 ++++++++++++++++++++++++++++
1 file changed, 149 insertions(+)
create mode 100755 contrib/mw-to-git/t/t9361-mw-to-git-pull.sh
diff --git a/contrib/mw-to-git/t/t9361-mw-to-git-pull.sh b/contrib/mw-to-git/t/t9361-mw-to-git-pull.sh
new file mode 100755
index 0000000..5f26cf5
--- /dev/null
+++ b/contrib/mw-to-git/t/t9361-mw-to-git-pull.sh
@@ -0,0 +1,149 @@
+#!/bin/sh
+#
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+#
+# License: GPL v2 or later
+
+# tests for git-remote-mediawiki
+
+test_description='Test the Git Mediawiki remote helper: git push and git pull simple test cases'
+
+. ./test-gitmw-lib.sh
+. $TEST_DIRECTORY/test-lib.sh
+
+TRASH_DIR="$CURR_DIR/trash\ directory.$(basename $0 .sh)"
+
+if ! test_have_prereq PERL
+then
+ skip_all='skipping gateway git-mw tests, perl not available'
+ test_done
+fi
+
+if [ ! -f $GIT_BUILD_DIR/git-remote-mediawiki ];
+then
+ skip_all='skipping gateway git-mw tests, no remote mediawiki for git found'
+ test_done
+fi
+
+if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ;
+then
+ skip_all='skipping gateway git-mw tests, no mediawiki found'
+ test_done
+fi
+
+
+test_expect_success 'Git pull works after adding a new wiki page' "
+ wiki_reset &&
+ cd $TRASH_DIR &&
+ rm -rf mw_dir &&
+ rm -rf ref_page &&
+
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage Foo \"page created after the git clone\" false &&
+
+ cd mw_dir &&
+ git pull &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ test_diff_directories mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+test_expect_success 'Git pull works after editing a wiki page' "
+ wiki_reset &&
+ cd $TRASH_DIR &&
+ rm -rf mw_dir &&
+ rm -rf ref_page &&
+
+ wiki_editpage Foo \"page created before the git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage Foo \"new line added on the wiki\" true &&
+
+ cd mw_dir &&
+ git pull &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ test_diff_directories mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+test_expect_success 'git pull works on conflict handled by auto-merge' "
+ wiki_reset &&
+ cd $TRASH_DIR &&
+ rm -rf mw_dir &&
+ rm -rf ref_page &&
+
+ wiki_editpage Foo \"1 init
+3
+5
+\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ wiki_editpage Foo \"1 init
+2 content added on wiki after clone
+3
+5
+\" false &&
+
+ cd mw_dir &&
+ echo \"1 init
+3
+4 content added on git after clone
+5
+\" > Foo.mw &&
+ git commit -am \"conflicting change on foo\" &&
+ git pull &&
+ git push &&
+ cd .. &&
+
+ rm -rf mw_dir
+"
+
+test_expect_success 'Merge conflict expected' "
+ wiki_reset &&
+ cd $TRASH_DIR &&
+ rm -rf mw_dir &&
+ rm -rf ref_page &&
+
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage Foo \"1 conflict
+3 wiki
+4\" false &&
+
+ cd mw_dir &&
+ echo \"1 conflict
+2 git
+4\" > Foo.mw &&
+ git add Foo.mw &&
+ git commit -m \"conflict created\" &&
+ test_must_fail git pull
+"
+
+test_expect_failure 'git pull works after deleting a wiki page' "
+ wiki_reset &&
+ cd $TRASH_DIR &&
+ wiki_editpage Foo \"wiki page added before the git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ wiki_delete_page Foo &&
+ cd mw_dir &&
+ git pull &&
+ test ! -f Foo.mw &&
+ cd .. &&
+
+ rm -rf mw_dir
+"
+
+test_done
+
--
1.7.10.2.552.gaa3bb87
next prev parent reply other threads:[~2012-06-11 20:29 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 20:27 [PATCH]Test environment for git-remote-mediawiki Simon.Cathebras
2012-06-11 20:28 ` [PATCHv3 1/6] Scripts to install, delete and clear a MediaWiki Simon Cathebras
2012-06-11 20:28 ` [PATCHv3 2/6] Test environment of git-remote-mediawiki Simon Cathebras
2012-06-11 20:28 ` [PATCHv3 3/6] Test file for git-remote-mediawiki clone Simon Cathebras
2012-06-11 21:07 ` konglu
2012-06-12 13:58 ` Simon.Cathebras
2012-06-11 20:28 ` Simon Cathebras [this message]
2012-06-11 21:09 ` [PATCHv3 4/6] Tests for git-remote-mediawiki pull konglu
2012-06-12 13:58 ` Simon Perrat
2012-06-12 21:12 ` [PATCH 1/6] Scripts to install, delete and clear a MediaWiki Simon Cathebras
2012-06-12 21:12 ` [PATCH 2/6] Test environment of git-remote-mediawiki Simon Cathebras
2012-06-13 7:56 ` Matthieu Moy
2012-06-13 8:10 ` Simon.Cathebras
2012-06-13 10:14 ` Ævar Arnfjörð Bjarmason
2012-06-13 17:00 ` Simon.Cathebras
2012-06-13 17:03 ` [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki Simon Cathebras
2012-06-13 17:03 ` [PATCHv5 2/5] Test environment of git-remote-mediawiki Simon Cathebras
2012-06-13 17:03 ` [PATCHv5 3/5] Test file for git-remote-mediawiki clone Simon Cathebras
2012-06-13 17:03 ` [PATCHv5 4/5] Tests for git-remote-mediawiki pull and push Simon Cathebras
2012-06-13 17:03 ` [PATCHv5 5/5] Tests of UTF8 character with git-remote-mediawiki Simon Cathebras
2012-06-14 8:57 ` [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki Matthieu Moy
2012-06-14 8:57 ` [PATCH 1/3] chmod -x test-gitmw-lib.sh Matthieu Moy
2012-06-14 8:57 ` [PATCH 2/3] Coding style Matthieu Moy
2012-06-14 8:57 ` [PATCH 3/3] Explicit error when curl_exec() fails Matthieu Moy
2012-06-14 9:23 ` Simon.Cathebras
2012-06-14 12:45 ` Matthieu Moy
2012-06-14 9:20 ` [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki Simon.Cathebras
2012-06-14 16:17 ` Matthieu Moy
2012-06-14 8:58 ` Matthieu Moy
2012-06-12 21:12 ` [PATCH 3/6] Test file for git-remote-mediawiki clone Simon Cathebras
2012-06-12 21:34 ` konglu
2012-06-13 7:20 ` Simon.Cathebras
2012-06-12 21:12 ` [PATCH 4/6] Tests for git-remote-mediawiki pull and push Simon Cathebras
2012-06-12 21:12 ` [PATCH 5/6] Tests of UTF8 character with git-remote-mediawiki Simon Cathebras
2012-06-12 21:18 ` Simon.Cathebras
2012-06-12 21:52 ` konglu
2012-06-13 7:30 ` Simon.Cathebras
2012-06-12 21:45 ` konglu
2012-06-11 20:28 ` [PATCHv3 5/6] Test file for git-remote-mediawiki push Simon Cathebras
2012-06-11 20:28 ` =?y?q?=5BPATCHv3=206/6=5D=20Tests=20of=20UTF8=20character=20with=20git-remote-mediawiki?= Simon Cathebras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339446526-22397-4-git-send-email-simon.cathebras@ensimag.imag.fr \
--to=simon.cathebras@ensimag.imag.fr \
--cc=Guillaume.Sasdy@ensimag.imag.fr \
--cc=Julien.Khayat@ensimag.imag.fr \
--cc=Matthieu.Moy@imag.fr \
--cc=Simon.Perrat@ensimag.imag.fr \
--cc=charles.roussel@ensimag.imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).