git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 14, 2012, 16:17 UTC
Message-ID
<vpqbokl6f6k.fsf@bauges.imag.fr>
In-Reply-To
<4FD9ACC6.50307@ensimag.imag.fr>
"Simon.Cathebras" <Simon.Cathebras@ensimag.imag.fr> writes:
Show 5 quoted lines
> Appears to be a local problem. Did you managed to run the script when
> this was fixed ?
>
> Anyway, please check out with the following wiki page if you have all
> required package.

Indeed, installing php5-cgi did it. I can now run the testsuite. But that would have been nice to get explicit error messages about this.

> url: https://github.com/Fafinou/git/wiki

This documentation should actually appear in the README file of your test environment. Wikis are nice to work collaboratively on a draft, but this kind of doc should really end up as close to the code as possible (currently, the code doesn't give a way to find the page above ...).

While testing/reviewing, I fixed a few more issues (patch below).

One thing I wanted to do was to let "install-wiki.sh" be launched from any directory, like "./t/install-wiki.sh install", but it's still not there, there are relative paths here and there that break it. Maybe we should just run cd "$WIKI_TEST_DIR" at the top. Or error out asking the user to cd himself.

From 084babd650376437d0fb4697d680d3c325316b7c Mon Sep 17 00:00:00 2001
From: Matthieu Moy <Matthieu.Moy@imag.fr>
Date: Thu, 14 Jun 2012 18:13:20 +0200
Subject: [PATCH] More fixups
---
 contrib/mw-to-git/t/Makefile                |  7 +++++--
 contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh |  8 ++++----
 contrib/mw-to-git/t/test-gitmw-lib.sh       | 20 +++++++++++---------
 3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/contrib/mw-to-git/t/Makefile b/contrib/mw-to-git/t/Makefile
index 752fd1f..0212b85 100644
--- a/contrib/mw-to-git/t/Makefile
+++ b/contrib/mw-to-git/t/Makefile
@@ -17,10 +17,13 @@ T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
 
 help:
 	@echo 'Run "$(MAKE) test" to launch test scripts'
-	@echo 'Run "$(MAKE)" clean to remove trash folders'
+	@echo 'Run "$(MAKE) clean" to remove trash folders'
 
 test:
-	for t in $(T); do "./$$t"; done
+	@for t in $(T); do \
+		echo "$$t"; \
+		"./$$t" || { echo "$$t failed"; exit 1; } \
+	done
 
 clean:
 	$(RM) -r 'trash directory'.*
diff --git a/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh b/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
index ee7cc9e..0add2d5 100755
--- a/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
+++ b/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
@@ -101,7 +101,7 @@ test_expect_success 'Git push works with a wiki with accents' '
 	test_diff_directories mw_dir_6 ref_page_6
 '
 
-test_expect_success 'Git clone works with accentsand spaces' '
+test_expect_success 'Git clone works with accents and spaces' '
 	wiki_reset &&
 	wiki_editpage "é à î" "this page must be délété before the clone" false &&
 	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_7 &&
@@ -166,7 +166,7 @@ test_expect_failure 'special character at the begining of file name from mw to g
 	test -f mw_dir_11/[char_2
 '
 
-test_expect_success 'test of correct formating for file name from mw to git' '
+test_expect_success 'correct formating for file name from mw to git' '
 	wiki_reset &&
 	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_12 &&
 	wiki_editpage char_%_7b_1 "expect to be renamed char{_1" false &&
@@ -184,7 +184,7 @@ test_expect_success 'test of correct formating for file name from mw to git' '
 '
 
 
-test_expect_failure 'test of correct formating for file name begining with special character' '
+test_expect_failure 'correct formating for file name begining with special character' '
 	wiki_reset &&
 	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_13 &&
 	(
@@ -203,7 +203,7 @@ test_expect_failure 'test of correct formating for file name begining with speci
 '
 
 
-test_expect_success 'test of correct formating for file name from git to mw' '
+test_expect_success 'correct formating for file name from git to mw' '
 	wiki_reset &&
 	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_14 &&
 	(
diff --git a/contrib/mw-to-git/t/test-gitmw-lib.sh b/contrib/mw-to-git/t/test-gitmw-lib.sh
index 36ac654..f444d1f 100644
--- a/contrib/mw-to-git/t/test-gitmw-lib.sh
+++ b/contrib/mw-to-git/t/test-gitmw-lib.sh
@@ -10,8 +10,12 @@
 # CONFIGURATION VARIABLES
 # You might want to change these ones
 #
+if test -z "$WIKI_TEST_DIR"
+then
+	WIKI_TEST_DIR=.
+fi
 
-. ./test.config
+. "$WIKI_TEST_DIR"/test.config
 
 export CURR_DIR=$(pwd)
 export TEST_DIRECTORY="$CURR_DIR"/../../../t
@@ -87,7 +91,7 @@ test_diff_directories () {
 #
 # Check that <dir> contains exactly <N> files
 test_contains_N_files () {
-	test `ls "$1" | wc -l` -eq "$2";
+	test `ls -- "$1" | wc -l` -eq "$2"
 }
 
 
@@ -101,8 +105,7 @@ wiki_check_content () {
 	#replacement of forbidden character in file name
 	page_name=$(printf "%s\n" "$2" | sed -e "s/\//%2F/g")
 
-	diff -b "$1" wiki_tmp/"$page_name".mw
-	if test $? -ne 0
+	if ! diff -b "$1" wiki_tmp/"$page_name".mw
 	then
 		rm -rf wiki_tmp
 		error "ERROR: file $2 not found on wiki"
@@ -268,9 +271,9 @@ start_lighttpd() {
 		stop_lighttpd
 	fi
 	config_lighttpd
-	$LIGHTTPD_DIR/lighttpd -f $WEB/lighttpd.conf
-
-	if test $? -ne 0 ; then
+	
+	if ! $LIGHTTPD_DIR/lighttpd -f $WEB/lighttpd.conf
+	then
 		echo "Could not execute http deamon lighttpd"
 		exit 1
 	fi
@@ -280,9 +283,8 @@ start_lighttpd() {
 #
 # Kill daemon lighttpd and removes files and folders associated.
 stop_lighttpd () {
-
 	test -f "$WEB_TMP/pid" && kill $(cat "$WEB_TMP/pid")
-	rm -rf $WEB
+	rm -rf "$WEB"
 }
 
 # Create the SQLite database of the MediaWiki. If the database file already
-- 
1.7.11.rc0.57.g84a04c7

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Simon.CathebrasNext: Matthieu Moy
Message 28 of 40 in “Test environment for git-remote-mediawiki”
  1. Test environment for git-remote-mediawikiSimon.Cathebras, Jun 11, 2012
  2. 1/6 Scripts to install, delete and clear a MediaWikiSimon Cathebras, Jun 11, 2012
  3. 2/6 Test environment of git-remote-mediawikiSimon Cathebras, Jun 11, 2012
  4. 3/6 Test file for git-remote-mediawiki cloneSimon Cathebras, Jun 11, 2012
  5. konglu@minatec.inpg.frJun 11, 2012
  6. Simon.CathebrasJun 12, 2012
  7. 4/6 Tests for git-remote-mediawiki pullSimon Cathebras, Jun 11, 2012
  8. konglu@minatec.inpg.frJun 11, 2012
  9. Simon PerratJun 12, 2012
  10. 1/6 Scripts to install, delete and clear a MediaWikiSimon Cathebras, Jun 12, 2012
  11. 2/6 Test environment of git-remote-mediawikiSimon Cathebras, Jun 12, 2012
  12. Matthieu MoyJun 13, 2012
  13. Simon.CathebrasJun 13, 2012
  14. Ævar Arnfjörð BjarmasonJun 13, 2012
  15. Simon.CathebrasJun 13, 2012
  16. 1/5 Scripts to install, delete and clear a MediaWikiSimon Cathebras, Jun 13, 2012
  17. 2/5 Test environment of git-remote-mediawikiSimon Cathebras, Jun 13, 2012
  18. 3/5 Test file for git-remote-mediawiki cloneSimon Cathebras, Jun 13, 2012
  19. 4/5 Tests for git-remote-mediawiki pull and pushSimon Cathebras, Jun 13, 2012
  20. 5/5 Tests of UTF8 character with git-remote-mediawikiSimon Cathebras, Jun 13, 2012
  21. Matthieu MoyJun 14, 2012
  22. 1/3 chmod -x test-gitmw-lib.shMatthieu Moy, Jun 14, 2012
  23. 2/3 Coding styleMatthieu Moy, Jun 14, 2012
  24. 3/3 Explicit error when curl_exec() failsMatthieu Moy, Jun 14, 2012
  25. Simon.CathebrasJun 14, 2012
  26. Matthieu MoyJun 14, 2012
  27. Simon.CathebrasJun 14, 2012
  28. Matthieu MoyJun 14, 2012
  29. Matthieu MoyJun 14, 2012
  30. 3/6 Test file for git-remote-mediawiki cloneSimon Cathebras, Jun 12, 2012
  31. konglu@minatec.inpg.frJun 12, 2012
  32. Simon.CathebrasJun 13, 2012
  33. 4/6 Tests for git-remote-mediawiki pull and pushSimon Cathebras, Jun 12, 2012
  34. 5/6 Tests of UTF8 character with git-remote-mediawikiSimon Cathebras, Jun 12, 2012
  35. Simon.CathebrasJun 12, 2012
  36. konglu@minatec.inpg.frJun 12, 2012
  37. Simon.CathebrasJun 13, 2012
  38. konglu@minatec.inpg.frJun 12, 2012
  39. 5/6 Test file for git-remote-mediawiki pushSimon Cathebras, Jun 11, 2012
  40. =?y?q?=5BPATCHv3=206/6=5D=20Tests=20of=20UTF8=20character=20with=20git-remote-mediawiki?=Simon Cathebras, Jun 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.